Unanswered question

How do I replace the URL path with an extracted variable?

I have a URL path for a GET request that is generated dynamically based on a content key that is being generated. I'm easily able to extract the content key from a previous response, but when I replace the Path with the extracted variable and check the user path, the test fails, and it's obvious that the variable isn't being applied.

For example, I extract a variable named, "Ext_Content01", then use that variable right from the variable picker, resulting in ${Ext_Content01} in the Path field. Upon playback, the GET fails, and the url in the playback response text shows:

GET https://www.servernamehere.com/$%7BExt_Content01%7D

So obviously the variable replacement isn't occurring. Am I missing some syntax which allows variables to be used in the URL Path?

Michael K.
Michael K.

Michael K.

Level
0
1 / 100
point

Answers

Nouredine A.
Nouredine A.

Nouredine A.

Level
4
5000 / 5000
points
Team

Usually when NeoLoad does not replace a variable it means that either you made a mistake in the name variable or that variable did not exist when it should be used.

Do you extract your value in the same page where you need to use it?

Niko M.
Niko M.

Niko M.

Level
0
65 / 100
points

Hi all,
a long time has passed, but I have the same issue with NeoLoad version 7.1 (Windows 7 Enterprise, x64).
In the designer the complete URL is displayed as followed:
http://myHost:4711${varSapFioriHomeBaseUrl}${varSapFioriHomeRelativeUrlPart1}?${varSapFioriHomeRelativeUrlPart2}&sap-cache-id=${varSapFioriHomeCacheId}

The server is MyHost with Port 4711 - configured in the server node.
But my "path" contains a lot of variables with parts of the final URL.

At the end (after the user path check) the variables are not replaced and the sended GET request is empty:
GET Accept: application/json
Accept-Encoding: br,deflate,gzip

The expected result is:
GET https://MyHost:4711/sap/opu/odata/UI2/PAGE_BUILDER_PE...
Accept: application/json
Accept-Encoding: br,deflate,gzip

All used variables are extracted fine in a previous response.
please have a look at the attached screenshot of the request of the user path check.
Please help.
Niko

Niko M.
Niko M.

Niko M.

Level
0
65 / 100
points

It's crazy ... I had the problem for hours and suddenly the variables are replaced.
I don't know the reason for that. Maybe a reload of the NL project is needed or the restart of NL made it work.
From my point of view it's a bug - difficult to reproduce, but definitively it's not a feature ;-)
Please find my current replacing situation in the attached screenshot.
Good luck for the future!
Niko

Niko M.
Niko M.

Niko M.

Level
0
65 / 100
points

OK, I was thinking about the problem:
Why - in the User Path Check - the first request contains the variable names instead the replacement/values and it works fine with the following requests?
So I inserted a new dummy request before the first request with variables within the path. And it seems to work, but the request needs to be within the same page. If it is in the Init section or in another page it doesn't solve the problem.
Please find attached screenshots of the dummy request followed by the first request with variables in the path.
Good luck!
Niko