0

I want to correlate values in my previous request sections EXTRARES to be used in the upcoming request as a normal URL.

First I have this:

web_url("considertakingadump", 

            "URL=http://mydevserver.test.local:8080/choice/toscana/{choiceId}/considertakingadump", 

            "TargetFrame=", 

            "Resource=0", 

            "RecContentType=text/html", 

            "Referer=http://mydevserver.test.local:8080/choice/toscana/{choiceId}/klargjore?3", 

            "Snapshot=t79.inf", 

            "Mode=HTML", 

            EXTRARES, 

            "Url=/choice/css/images/icon_ikke_ok.png", "Referer=http://mydevserver.test.local:8080/choice/toscana/{choiceId}/considertakingadump?5", ENDITEM, 

            "Url=/choice/css/images/navigasjon/Navigation_top_2_considertakingadump.png", "Referer=http://mydevserver.test.local:8080/choice/toscana/{choiceId}/considertakingadump?5", ENDITEM, 

            "Url=/choice/css/images/icon_ok.png", "Referer=http://mydevserver.test.local:8080/choice/toscana/{choiceId}/considertakingadump?5", ENDITEM, 

            LAST);

Then I have this:

    web_url("Next", 

            "URL=http://mydevserver.test.local:8080/choice/toscana/{choiceId}/considertakingadump?5-1.ILinkListener-next", 

            "TargetFrame=", 

            "Resource=0", 

            "RecContentType=text/html", 

            "Referer=http://mydevserver.test.local:8080/choice/toscana/{choiceId}/considertakingadump?5", 

            "Snapshot=t80.inf", 

            "Mode=HTML", 

            EXTRARES, 

            "Url=/choice/css/images/navigasjon/Navigation_top_2_considertakingadump.png", "Referer=http://mydevserver.test.local:8080/choice/toscana/{choiceId}/forslagchoice?6", ENDITEM, 

            LAST);

The number 5 in considertakingadump?5 above (in the URL section of the web_url("Next") is what I want to replace with the value of the first request (in the EXTRARES section of the web_url("considertakingadump")).

How can I correlate values in the EXTRARES part of a request to be used in the preciding request?

Magnus Jensen
  • 905
  • 6
  • 36
  • 73

2 Answers2

0

When you use the web_reg_save_param() or web_reg_save_param_ex() functions, they apply to ALL the responses that you receive from a web_url().

So just add the web_reg_save_* calls before the web_url() and you should be good.

Note that the saved stuff is the 1st found that matches, so if you have 2 or more matches in different responses you need to have the "Ord=All" option on and get them all.

K.Sandell
  • 1,369
  • 10
  • 19
0

You cannot take a dynamic data element for a succeeding request and apply it to a request which has already occurred. What you can do is break this one request into a URL mode request. For example, save the script file twice for two different names. Regenerate one of the two in URL Mode. Replace the one request and all of the URL/EXTRARES references with the appropriate number of requests from the URL mode generation.

Then correlate for the first instance of the dynamic data element which you require. If you are not able to correlate from a server data flow, then consider that the value might be coming from a piece of client side code in JavaScript. Find the JavaScript algorithm in question and either convert your JavaScript to and appropriate language function for your virtual user or convert your virtual user type to TruClient/GUI/Citrix/RDP

James Pulley
  • 5,606
  • 1
  • 14
  • 14