HomeSUPPORT QUESTIONS

Need help with StresStimulus? Start here.

Replacing a host Messages in this topic - RSS

Unregistered User
Unregistered User
Posts: 140


4/6/2012
Unregistered User
Unregistered User
Posts: 140
Can I parameterize the site URL? 
I am now making tests on a site named for example "site.com"
Tomorrow the site will be named "site.nl"
 
I want to know if there is a way to simply give the site name as a parameter. The structure will be the same, only the name will differ.
 
Kind Regards,
Ana
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


4/6/2012
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Hi Ana,

In order to change a host in the test, go to Test Configuration -> Other Options and click the “Change Host" button. This will invoke the Fiddler's "Host Remapping" dialog box. Check the checkbox and in the textbox, type the New Host followed by the Old Host.

Cheers,
-Vadim
0 link
ana podeanu
ana podeanu
Posts: 3


4/6/2012
ana podeanu
ana podeanu
Posts: 3
Yes I did this but all I got are errors.
<title>The resource cannot be found.</title>
<style>
body {font-family:"Verdana";font-weight:normal;font-size: .7em;color:black;}
p {font-family:"Verdana";font-weight:normal;color:black;margin-top: -5px}
b {font-family:"Verdana";font-weight:bold;color:black;margin-top: -5px}
H1 { font-family:"Verdana";font-weight:normal;font-size:18pt;color:red }
H2 { font-family:"Verdana";font-weight:normal;font-size:14pt;color:maroon }
pre {font-family:"Lucida Console";font-size: .9em}
.marker {font-weight: bold; color: black;text-decoration: none;}
.version {color: gray;}
.error {margin-bottom: 10px;}
.expandable { text-decoration:underline; font-weight:bold; color:navy; cursor:hand; }
</style>
</head>
<body bgcolor="white">
<span><H1>Server Error in '/' Application.<hr width=100% size=1 color=silver></H1>
<h2> <i>The resource cannot be found.</i> </h2></span>
<font face="Arial, Helvetica, Geneva, SunSans-Regular, sans-serif ">
<b> Description: </b>HTTP 404. The resource you are looking for (or one of its dependencies) could have been removed, had its name changed, or is temporarily unavailable. &nbsp;Please review the following URL and make sure that it is spelled correctly.
<br><br>
<b> Requested URL: </b>/Login.aspx<br><br>
</body>
</html>

What can be the problem?
Should I include somehow the IP of the Virtual machine where the newsite is located?
I've typed in hosts: newsite.test oldsite.dev
0 link
ana podeanu
ana podeanu
Posts: 3


4/6/2012
ana podeanu
ana podeanu
Posts: 3
Another question if you don't mind.
Once the host is replaced in Other options  when running the test in the debug mode the requests should be viewed as requests to the old host or to the new host?
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


4/6/2012
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Ana,

Apparently, Fiddler's "Host Remapping" feature, while changing the host, displays the old host in the session information because, by design, Fiddler displays requests issued by the browser and not by the proxy. This makes it a little more difficult to debug the HTTP 404 error, which you pasted above. We will look into making an adjustment in the next StresStimulus version to display the new host in the replayed sessions.

As far as troubleshooting the HTTP 404. error: check if you typed the new host correctly, and whether your new host is available and responding.

Cheers.
-Vadim
0 link
ana podeanu
ana podeanu
Posts: 3


4/7/2012
ana podeanu
ana podeanu
Posts: 3
Is there another way to replace the HOST? maybe more hard coded. It really doesn't work and I didn't manage to get a answer why. No matter if is harder I would like to try a different way.
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


4/7/2012
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Ana,

One way to isolate the issue with "Host Remapping"  is to exclude StresStimulus from the equation. In HOSTS... item in the Tools menu, set the rule to re-target requests from one host to another, Then in the browser navigate to the old host and you should receive responses from the new host. For more information check this source http://www.fiddler2.com/fiddler/help/hosts.asp


Also,  there is another way to replace a host by using the bulk urlreplace add-on. You can set a search/replace rule that finds the old host and replaces it with the new host.   Check the item #2 in this post http://www.stresstimulus.com/blog/post/v1-0-release-notes

Cheers,
-Vadim
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


5/17/2012
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Update: in the V 1.7  we improved the integration with Fiddler's "Host Remapping".  Now, instead of displaying the recorded host, the Fiddler grid displays the new host that is actually targeted during the load test. This makes it easier to read the load test results, and, in the situations with errors, like one described in this post, it makes it easy to debug the errors.
0 link
mike h
mike h
Posts: 2


8/16/2012
mike h
mike h
Posts: 2
So, if I have 100 (identical in my case) sites on my IIS box, and I want to randomly test some scenarios against each site during a test run, to see IIS load performance rather than individual site performance, how do I do this?

Is there a way to replace the virtual directory or host name during a test?

E.g. my sites are configured as follows:
www.testsite.co.nz/site_1000/
www.testsite.co.nz/site_1001/
www.testsite.co.nz/site_1002/

A test scneario for each site would be to login (forms auth), perform some action, logout.


I was hoping to replace the 1000 with 1021 or whatever using a Rand() function during a test - such that all requests in a transaction are going to the same site.  But next transaction would potentially be to a different site.
Thanks!
0 link
mike h
mike h
Posts: 2


8/17/2012
mike h
mike h
Posts: 2
OK, have kind of found the answer to my own question.
Am using a data source of hosts with values '/site_1001/' etc., and setting URL parameters on each of the pages in my test, using VU Binding.
This is pretty close to what I want.  But it means I have to have a VU for each site I want tested.  Is probably going to be OK for our needs.
Cheers!
0 link
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583


8/17/2012
Vadim @StresStimulus
Vadim @StresStimulus
Administrator
Posts: 583
Hi Mike,
Good workaround. Ideally, you probably need every VU in the beginning of every iteration to receive a random number between 1000 and 1099, which you can use to parameterize URL throughout the iteration. If you wish to explore this path, here are the steps that I suggest:

  1. Write a function that adds to responses a custom header, let's say, MyRndVirtDir with a random number (or replace the value of the existing header).

  2. Call this function insight OnBeforeResponse on the first response of every iteration. To determine whether the response is the first one, use StresStimulus flag x-ws-url.  To access the flags, use oSession["<flag_name>"] or oSession.oFlags["<flag_name>"] syntax.

  3. In StresStimulus test, create an extractor from MyRndVirtDir header and use it to parameterize the URL in the subsequent requests.


For more information on Fiddler scripting, check http://www.fiddlertool.com/fiddler/dev/scriptsamples.asp
You would need to use the latest StresStimulus v2.0 version released today, as it has better support for header extractors and URL parameterization described in this post http://www.stresstimulus.com/blog/post/v2-0-update-3-part-2-other-enhancements

Cheers,
-Vadim
0 link






Copyright © 2017 Stimulus Technology