Answered question

How to use Javascript return value in URL request as parameter?

I have an extracted variable from a response (which is page number in application). I have created a Javascript to use this extracted variable value as its parameter (numeric) and coded it to return a number (previous page number). Now I want to use the return value of Javascript in a new request as one of the parameter. I tried steps in attached screenshot but I failed. Please help me. Thanks in advance.

Infotech G.
Infotech G.

Infotech G.

Level
0
58 / 100
points
Neil W.
Neil W.

Neil W.

Level
4
5000 / 5000
points
Team

a Javascript snippet is not a function that will return a value, in your snippet, comment back in line 22 from the second screenshot and . comment out lines 12, 13 and 14 (its a function with no call to it).

myVar is text so -1 wont substract a 1, we need to turn it into an integer. for example context.variableMaager.setValue("myNLvar", parseInt(myVar)-1) where myNLvar is the neoload variable in your request

Did you find this useful ?

No (0)

Yes (1)

100%

100% of users found this answer useful

Other answers

Infotech G.
Infotech G.

Infotech G.

Level
0
58 / 100
points

Thanks Neil, it worked.