URL keeps changing

hie ,

i have a requirement where https://externalqa.econnectivity.com/alertTypeID=26&pageName=AAA&jNumber=56001234
in this url the jNumber keeps changing and i have this url in assert . how do i replace the value of jnumber as per requirement ?

You can store the jNumber in variable and build the URL dynamicaly using “string.format” method like this

jNumberVar="56001234"
url = string.format("https://externalqa.econnectivity.com/alertTypeID=26&pageName=AAA&jNumber={0}", jNumberVar)

or simply by cocatenating strings

jNumberVar="56001234"
urlBaseVar="https://externalqa.econnectivity.com/alertTypeID=26&pageName=AAA&jNumber="
url = urlBaseVar + jNumberVar

Cheers

Hi @Pooja_Kanwar

You can keep this url in your asset i.e urlTemplate = https://externalqa.econnectivity.com/alertTypeID=26&pageName=AAA&jNumber={jNum}

and then replace the jnum according to the requirement
finalUrl = urlTemplate.replace({jNum}, jNumber)

Hope this helps