HomeSUPPORT QUESTIONS

Need help with StresStimulus? Start here.

Replacing the Path Messages in this topic - RSS

shammann
shammann
Posts: 6


6/29/2017
shammann
shammann
Posts: 6
I am new to StresStimulus, trying it out for the first time today. I recorded a bunch of tests against one site, and now I want to point the same tests to another site that has the same codebase, but has a different host and path (i.e. the app directory name in IIS is diifferent). I see how to use Host Remapping to target a different host, but the only way I can see to change the first part of the path in all the requests, is to create a script that returns the new value, and sub it in individually on every single test step. That seems very inefficient, and unworkable over time as a way to accomplish this. Is there some simpler way to do this substitution? Many thanks!
0 link
George @StresStimulus
George @StresStimulus
Administrator
Posts: 132


6/30/2017
George @StresStimulus
George @StresStimulus
Administrator
Posts: 132
Let me make sure I understand your situation. You have an application that has the following URL: http(s)://[host]/[vpath]/[file] and you want to change the [host] and [path] for every request.
To change the recorded [host] just use host remapping feature which you mentioned.
To change the recorded [path], follow these steps :
  • Create a new scriptable variable and call it, let say VirtualPath. http://support.stresstimulus.com/display/doc46/Internal+Scriptable+Variables
  • In the GetValue method replace throw new NotImplemenetedException() with return “[newPath]”; where [newPath] is the name of your new path. This can always be edited later when the [newPath] changes.
  • Next you need to parameterize all requests and change /[vpath]/ to /{{newPath}}/ In the test case tree right click on the first request and select Create Parameter.
  • Switch to Parameterization Editor http://support.stresstimulus.com/display/doc46/Parameterization+Editor
  • Hit Ctrl+F to bring up the Find/Replace dialog http://support.stresstimulus.com/display/doc46/Creating+Multiple+Parameters+from+Editors
  • In the find what textbox type: /[vpath]/
  • In the replace with type: /{{newPath}}/
  • In the search scope select: All Requests
  • Hit the Bulk Replace button.

  • Hope this helps.

    Keywords: target, remapping, retargeting
    0 link






    Copyright © 2018 Stimulus Technology