<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Waldemar's blog &#187; LoadRunner</title>
	<atom:link href="http://blog.testsautomation.com/category/loadrunner/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.testsautomation.com</link>
	<description>Live fast, die old...</description>
	<lastBuildDate>Mon, 12 Jul 2010 20:51:33 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>My LoadRunner Tips and Tricks</title>
		<link>http://blog.testsautomation.com/2010/07/my-loadrunner-tips-and-tricks/</link>
		<comments>http://blog.testsautomation.com/2010/07/my-loadrunner-tips-and-tricks/#comments</comments>
		<pubDate>Mon, 12 Jul 2010 20:47:34 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=589</guid>
		<description><![CDATA[Few tips&#038;tricks to make working with LoadRunner easy:
- Store URL of your application in one single parameter. In case you need to change it, it requires a single change in one place, not tons of them for every single web request.
- If you don&#8217;t know why your HTTP/HTTPS request is failing, use proxy to sniff [...]]]></description>
			<content:encoded><![CDATA[<p>Few tips&#038;tricks to make working with LoadRunner easy:</p>
<p>- Store URL of your application in one single parameter. In case you need to change it, it requires a single change in one place, not tons of them for every single web request.</p>
<p>- If you don&#8217;t know why your HTTP/HTTPS request is failing, use proxy to sniff it and them compare it with the same request but generated from real browser. As a proxy you can use WebScarab or Fiddler. </p>
<p>- Separate load logic using actions, don&#8217;t store whole load in a huge single action that LR created be default at the beginning.</p>
<p>- Create web_reg_find() checkpoint for every HTTP request that you make. You don&#8217;t want to pass failing transations.</p>
<p>- On parameter setup, beware using &#8220;Update value&#8221; set to &#8220;Once&#8221;. Rather use &#8220;Every iteration&#8221;. If you mess it up somehow, at least only current iteration will fail, not all of them.</p>
<p>- For scripts that handle UI actions (like Web Click&#038;Script or AJAX Click&#038;Script) use &#8220;Run every user as a process&#8221; instead of &#8220;Run every user as a thread&#8221;. LR is not very good at memory management for such scripts so it&#8217;s better to run each vuser separately. </p>
<p>- Don&#8217;t use extended log level while running test in a Controller. One more time LR is not very good at handling it. Rather use basic level and if there is an issue switch to VuGen to digg for it. </p>
<p>- In LR Analysis, check performance results on a summary graph instead of &#8220;Average transactions response times&#8221; graph. </p>
<p>- Place 1 second wait before first call to the server. If server breaks, you won&#8217;t flood it with bunch of requests.</p>
<p>- Try to avoid using standard C string functions (strcpy, strcat, etc&#8230;) if you can. Or if you really need, just remember about null pointer issue. More details here http://blog.testsautomation.com/2009/11/exception-access_violation/.</p>
<p>- Comment your code &#8211; at the end LR script is (most cases) a C program. So all programming best practices apply as well.</p>
<p>- Make your code to look nice (tabs, indents, etc&#8230;). It will be easier for you to work with it and spot any issue.</p>
<p>- Don&#8217;t hard code anything. Instead put it into parameter. </p>
<p>- If some calls repeat constantly, put them into separate action and call this action instead. It will help you during refactoring your tests. </p>
<p>- NEVER store Controller scenario in QualityCenter. It&#8217;s just bad idea. Use local hard drive for it. Controller can store really big files there. </p>
<p>- When you work on a script in VuGen, try to run it there at lest for 2 or 3 iterations. Sometimes errors occur only after the first iteration.</p>
<p>- If you want you can store LR script on a shared drive. It won&#8217;t affect your tests since Controller will always copy it to temp directory before running the scenario (even if the script is stored locally on the same drive).</p>
<p>- If you want to send LR script to someone use File -> Zip Operations -> Zip and Email. On popup select &#8220;Run-Time files&#8221; instead of &#8220;All files&#8221;. This second options can zip results as well which may generate really unnecessary huge file.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2010/07/my-loadrunner-tips-and-tricks/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LoadRunner levels of integration with web pages</title>
		<link>http://blog.testsautomation.com/2010/03/loadrunner-levels-of-integration-with-web-pages/</link>
		<comments>http://blog.testsautomation.com/2010/03/loadrunner-levels-of-integration-with-web-pages/#comments</comments>
		<pubDate>Tue, 09 Mar 2010 10:25:31 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[performance]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=508</guid>
		<description><![CDATA[LoadRunner basically allows two approches for load testing your web application. Before going into details lets see how communication between user and web server looks like.

As you can see between user and web server there are mainly 2 layers: 

Layer 1 is where user interacts with the browser by e.g. clicking a button, selecting values [...]]]></description>
			<content:encoded><![CDATA[<p>LoadRunner basically allows two approches for load testing your web application. Before going into details lets see how communication between user and web server looks like.</p>
<p><img alt="" src="http://blog.testsautomation.com/wp-includes/images/user.png" class="alignnone" width="574" height="170" /></p>
<p>As you can see between user and web server there are mainly 2 layers: </p>
<ul>
<li><b>Layer 1</b> is where user interacts with the browser by e.g. clicking a button, selecting values from the list or submitting a form</li>
<li><b>Layer 2</b> is where browser communicates with web server which includes:
<ul>
<li>creating and sending HTTP requests to the web server based on user&#8217;s actions</li>
<li>receiving HTTP responses from the web server</li>
<li>rendering HTTP responses, forming an UI and displaying it to the user</li>
</ul>
</li>
</ul>
<p>Below I&#8217;m providing two scripts that do exactly the same thing but in slightly different way. The goal for each script is to search for a &#8220;linux&#8221; word using google search.</p>
<p>First, lets look at &#8220;Web (HTTP/HTML)&#8221; type of the script:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">Action<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; web_url<span class="br0">&#40;</span><span class="st0">&quot;www.google.com&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;URL=http://www.google.com/&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Resource=0&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;RecContentType=text/html&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Referer=&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Snapshot=t1.inf&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Mode=HTML&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LAST<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; lr_think_time<span class="br0">&#40;</span><span class="nu0">6</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; web_url<span class="br0">&#40;</span><span class="st0">&quot;search&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;URL=http://www.google.co.uk/search?hl=en&amp;source=hp&amp;q=linux&amp;btnG=Google+Search&amp;meta=&amp;aq=f&amp;oq=&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Resource=0&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;RecContentType=text/html&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Referer=http://www.google.co.uk/&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Snapshot=t2.inf&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Mode=HTML&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LAST<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<p>What happens here?</p>
<ul>
<li>In line 3 we are entering google.com web site</li>
<li>In line 14 we are sending HTTP request that browser would generate after searching for value &#8220;linux&#8221;</li>
</ul>
<p>Now, lets look at &#8220;Web (Click and Script)&#8221; type of the script:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">Action<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; web_browser<span class="br0">&#40;</span><span class="st0">&quot;www.google.com&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DESCRIPTION, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ACTION, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Navigate=http://www.google.com/&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LAST<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; web_edit_field<span class="br0">&#40;</span><span class="st0">&quot;q&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Snapshot=t1.inf&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DESCRIPTION, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Type=text&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Name=q&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ACTION, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;SetValue=linux&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LAST<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; web_button<span class="br0">&#40;</span><span class="st0">&quot;INPUT&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Snapshot=t2.inf&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; DESCRIPTION, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Type=submit&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Tag=INPUT&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;ID=&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Value=Google Search&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; ACTION, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;UserAction=Click&quot;</span>, </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LAST<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<ul>
<li>In line 4 we are entering google.com web site</li>
<li>In line 10 we are typing value &#8220;linux&#8221; into the input field</li>
<li>In line 19 we are clicking &#8220;Google Search&#8221; button that will move us to the page with search results</li>
</ul>
<p>So what is the difference between these two scripts?</p>
<p>First script operates on much lover level comparing to second script. It deals with HTTP requests without taking care about what actions user actually performs. It doesn&#8217;t care how fast user&#8217;s browser renders and display the UI. It only checks how fast web server is able to response with correct message.</p>
<p>Second script operates only on UI level without taking care what happens underneath. Response time here includes not only time needed to send/receive HTTP traffic but also time needed to form/display UI to the user.</p>
<p>Basically second script approach is less error prone because you don&#8217;t have to deal with low level things like HTTP parameters. And You are replicating user&#8217;s actions in a natural way. </p>
<p>So if you need to choose, then I would recommend Web Click and Script type of the script. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2010/03/loadrunner-levels-of-integration-with-web-pages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Average transaction response time vs Granularity</title>
		<link>http://blog.testsautomation.com/2009/11/average-transaction-response-time-vs-granularity/</link>
		<comments>http://blog.testsautomation.com/2009/11/average-transaction-response-time-vs-granularity/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 09:56:00 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[analysis]]></category>
		<category><![CDATA[granularity]]></category>
		<category><![CDATA[response time]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=423</guid>
		<description><![CDATA[Correct me if I&#8217;m from but I always thought that for particular transaction there should be only ONE average response time. But it looks like it&#8217;s not the case in LR Analysis. 
I recently discovered that by changing granularity on average transaction response time graph, Analysis also recalculates average times under the graph. In my [...]]]></description>
			<content:encoded><![CDATA[<p>Correct me if I&#8217;m from but I always thought that for particular transaction there should be only ONE average response time. But it looks like it&#8217;s not the case in LR Analysis. </p>
<p>I recently discovered that by changing granularity on average transaction response time graph, Analysis also recalculates average times under the graph. In my understanding granularity is responsible only for making the graph easier to read and thats all it should do. But by changing granularity we are also changing how many points LR actually counts which results in different average response times for different granularity.</p>
<p>So shame that this is not mentioned in the manual. Of course according to HP support it is mentioned there and this is a feature, not a bug <img src='http://blog.testsautomation.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>So my tip for today: be careful when looking at response times on average transaction response graph. Use &#8220;Summary&#8221; page if you want to omit any mistakes.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2009/11/average-transaction-response-time-vs-granularity/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Exception ACCESS_VIOLATION</title>
		<link>http://blog.testsautomation.com/2009/11/exception-access_violation/</link>
		<comments>http://blog.testsautomation.com/2009/11/exception-access_violation/#comments</comments>
		<pubDate>Sat, 07 Nov 2009 09:33:31 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[access_violation]]></category>
		<category><![CDATA[null]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=373</guid>
		<description><![CDATA[Web (HTTP/HTML) scripts in LoadRunner are implemented using C programming language. And like always with C, you should remember about some basics. One of them is that few string handling function can return NULL value instead of correct pointer which will definitely lead to exception like the one below:




Action.c&#40;7&#41;: Error: C interpreter run time error: [...]]]></description>
			<content:encoded><![CDATA[<p>Web (HTTP/HTML) scripts in LoadRunner are implemented using C programming language. And like always with C, you should remember about some basics. One of them is that few string handling function can return NULL value instead of correct pointer which will definitely lead to exception like the one below:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">Action.<span class="me1">c</span><span class="br0">&#40;</span><span class="nu0">7</span><span class="br0">&#41;</span>: Error: C interpreter run time error: Action.<span class="me1">c</span> <span class="br0">&#40;</span><span class="nu0">7</span><span class="br0">&#41;</span>: &nbsp;Error &#8212; memory violation : Exception ACCESS_VIOLATION received.</div>
</li>
</ol>
</div>
</div>
<p>Basically if you see message like this, it is not any internal LoadRunner error. It means that you made a mistake in your script and you need to fix it. But let&#8217;s start from the beginning with some example:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">Action<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">char</span> * x_p;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; lr_save_string<span class="br0">&#40;</span><span class="st0">&quot;hello_world!&quot;</span>, <span class="st0">&quot;MESSAGE&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; x_p = <span class="br0">&#40;</span><span class="kw4">char</span> *<span class="br0">&#41;</span>strchr<span class="br0">&#40;</span>lr_eval_string<span class="br0">&#40;</span><span class="st0">&quot;{MESSAGE}&quot;</span><span class="br0">&#41;</span>, <span class="st0">&#8216; &#8216;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; lr_save_string<span class="br0">&#40;</span>x_p, <span class="st0">&quot;MESSAGE_FROM_SP&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; lr_output_message<span class="br0">&#40;</span>lr_eval_string<span class="br0">&#40;</span><span class="st0">&quot;{MESSAGE_FROM_SP}&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<p>This small piece of code takes parameter MESSAGE with value &#8220;hello_world&#8221;, then search for the first space character and display the string starting from that place up to the end. Function strchr() is responsible for searches for the space character. If it&#8217;s found then strchr() will return a valid pointer (something like 0xb36ac56e). But if the space is not there (which is our case since there is no space in the hello message), strchr() will return NULL which refers to 0&#215;0 memory address location.</p>
<p>Such memory address is a very special address. Basically any read attempt from there is threated as incorrect operation and results in memory access violation (not only in LoadRunner).</p>
<p>Now, howto deal with it? If you see ACCESS_VIOLATION, in most cases it means that your LR script is working on incorrect/incomplete values. You are responsible for error handling in your scripts and you should always:</p>
<ul>
<li>validate parameter&#8217;s values</li>
<li>check results of C functions to handle any errors, unexpected conditions</li>
<li>remember that you can&#8217;t always expect correct values and you need to handle it as well</li>
</ul>
<p>Here is our example with fix showing howto deal with ACCESS_VIOLATION. We are calling strchr() function and checking if value returned is not NULL.</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">Action<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">char</span> * x_p;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; lr_save_string<span class="br0">&#40;</span><span class="st0">&quot;hello_world!&quot;</span>, <span class="st0">&quot;MESSAGE&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; x_p = <span class="br0">&#40;</span><span class="kw4">char</span> *<span class="br0">&#41;</span>strchr<span class="br0">&#40;</span>lr_eval_string<span class="br0">&#40;</span><span class="st0">&quot;{MESSAGE}&quot;</span><span class="br0">&#41;</span>, <span class="st0">&#8216; &#8216;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">if</span><span class="br0">&#40;</span>x_p<span class="br0">&#41;</span> <span class="co1">// if the pointer is not NULL display correct message</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lr_save_string<span class="br0">&#40;</span>x_p, <span class="st0">&quot;MESSAGE_FROM_SP&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lr_output_message<span class="br0">&#40;</span>lr_eval_string<span class="br0">&#40;</span><span class="st0">&quot;{MESSAGE_FROM_SP}&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">else</span> <span class="co1">//if pointer is NULL display error message</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lr_error_message<span class="br0">&#40;</span><span class="st0">&quot;Space not found in MESSAGE parameter&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<p>More details about NULL pointer here <a href="http://en.wikipedia.org/wiki/Pointer_(computing)#The_null_pointer" target="_blank">http://en.wikipedia.org/wiki/Pointer_(computing)#The_null_pointer</a></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2009/11/exception-access_violation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>LoadRunner + QTP = End-to-End performance</title>
		<link>http://blog.testsautomation.com/2009/10/loadrunner-qtp-end-to-end-performance/</link>
		<comments>http://blog.testsautomation.com/2009/10/loadrunner-qtp-end-to-end-performance/#comments</comments>
		<pubDate>Fri, 02 Oct 2009 11:16:52 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[loadrunner qtp performance end-to-end]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=338</guid>
		<description><![CDATA[The easiest way to measure web app performance is just to record a script and run it in HP Controller. Such test is fast and simple, but it's also incomplete and incorrect. It's because LoadRunner is not the tool for performance measuring. It's a tool only for generating the load on the server (Load Runner - tool for "Running" the "Load"). 

So how to deal with that?]]></description>
			<content:encoded><![CDATA[<p>The easiest way to measure web app performance is just to record a script and run it in HP Controller. Such test is fast and simple, but it&#8217;s also incomplete and incorrect. It&#8217;s because LoadRunner is not the tool for performance measurements. It&#8217;s a tool only for generating the load on the server (Load Runner &#8211; tool for &#8220;Running&#8221; the &#8220;Load&#8221;). </p>
<p>So how to deal with that?</p>
<p>LoadRunner finishes taking measurements when web page code and all non-HTML elements (jpg,gif,js) are download into the clients memory. But starting from that point the browser need to form UI and display it to the user. And that&#8217;s the part that LR is actually skipping. Full end-to-end test should measure time between clicking &#8220;submit&#8221; button (or whatever triggers a call) and displaying full page within the browser. So how to do it in LR? The quickest answer is &#8220;not possible&#8221;. For that you need to use QuickTest Professional. </p>
<p>In that case of course you need at least two scripts. One prepared in LoadRunner and second prepared in QTP. Each script will have different task to accomplish. LR script will generate the load on the server simulating different amount of remote users connecting with AUT. QTP script will measure times only for one user, and that&#8217;s what we actually need. I believe every single web user care only about how fast page works in his browser. Not how fast it works across all remote users together in average. Of course one is connected with the another.</p>
<p>LoadRunner and QTP have one thing in common &#8211; transactions. And basically to measure end-to-end time in QTP all you need to do is to use transactions and remember to synchronize each page correctly. By synchronize I mean to finish transaction when page is fully downloaded and displayed to the user. One solutions for checking when downloading is finished is to call WaitProperty on browser&#8217;s status bar element. Example QTP code:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">Services.<span class="me1">StartTransaction</span> <span class="st0">&quot;SUBMIT_PAGE&quot;</span></div>
</li>
<li class="li1">
<div class="de1">Browser<span class="br0">&#40;</span><span class="st0">&quot;IE&quot;</span><span class="br0">&#41;</span>.<span class="me1">Page</span><span class="br0">&#40;</span><span class="st0">&quot;Add_User&quot;</span><span class="br0">&#41;</span>.<span class="me1">Image</span><span class="br0">&#40;</span><span class="st0">&quot;Submit&quot;</span><span class="br0">&#41;</span>.<span class="me1">Click</span> <span class="nu0">50</span>,<span class="nu0">16</span></div>
</li>
<li class="li1">
<div class="de1">Browser<span class="br0">&#40;</span><span class="st0">&quot;IE&quot;</span><span class="br0">&#41;</span>.<span class="me1">WinObject</span><span class="br0">&#40;</span><span class="st0">&quot;Status_Bar&quot;</span><span class="br0">&#41;</span>.<span class="me1">WaitProperty</span> <span class="st0">&quot;visible&quot;</span>, <span class="kw2">FALSE</span></div>
</li>
<li class="li1">
<div class="de1">Services.<span class="me1">EndTransaction</span> <span class="st0">&quot;SUBMIT_PAGE&quot;</span></div>
</li>
</ol>
</div>
</div>
<p>If you have LR and QTP scripts already in place, now just add them in HP Controller into your scenario. To see QTP scripts in Browse window just change File Type from &#8220;Vuser Scripts&#8221; into &#8220;QuickTest scripts&#8221;. One think to remember is that you are allowed to run only single QTP instance at a time so hacks like few QTP scripts running simultaneously are not possible (unless you are using Citrix which is another story).</p>
<p>Only with such scenario you are able to measure full end-to-end performance.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2009/10/loadrunner-qtp-end-to-end-performance/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Services testing in LoadRunner</title>
		<link>http://blog.testsautomation.com/2009/07/web-services-testing-in-loadrunner/</link>
		<comments>http://blog.testsautomation.com/2009/07/web-services-testing-in-loadrunner/#comments</comments>
		<pubDate>Fri, 24 Jul 2009 22:16:12 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[loadrunner soap soa webservice]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=285</guid>
		<description><![CDATA[Some time ago I described how to test web services in LoadRunner with HTTP/HTML script. Right now I would like to describe the correct way &#8211; testing with Web Services script.
First of all we need a web services. And there is one available exactly for training. Here is the WSDL http://soatest.parasoft.com/store-01.wsdl. I hope that folks [...]]]></description>
			<content:encoded><![CDATA[<p>Some time ago I described how to test web services in LoadRunner with HTTP/HTML script. Right now I would like to describe the correct way &#8211; testing with Web Services script.</p>
<p>First of all we need a web services. And there is one available exactly for training. Here is the WSDL http://soatest.parasoft.com/store-01.wsdl. I hope that folks from Parasoft don&#8217;t mind we are not using SOATest <img src='http://blog.testsautomation.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>In any case, we have an WSDL file. Now lets create new script. </p>
<p>Click File / New and select &#8220;Web Services&#8221; from list of available scripts types. </p>
<p><img src="http://blog.testsautomation.com/wp-content/uploads/2009/07/1.jpg" alt="1" title="1" width="520" height="360" class="aligncenter size-full wp-image-286" /></p>
<p>Now, when we have new script we should see new toolbar under the standard one. It allows to add Web Services description to the script (from WSDL file), add XML request using form and add XML request from file. So lets click on &#8220;Manage Services&#8221; button and then &#8220;Import&#8221;. Enter WSDL url http://soatest.parasoft.com/store-01.wsdl and click &#8220;Import&#8221;.</p>
<p><img src="http://blog.testsautomation.com/wp-content/uploads/2009/07/2.jpg" alt="2" title="2" width="673" height="603" class="aligncenter size-full wp-image-295" /></p>
<p>After WSDL file is imported, just click &#8220;Apply&#8221; and &#8220;OK&#8221;. From this point LoadRunner has description of our web services so we can use it send some requests. We will actually create two requests. One using &#8220;Add Service Call&#8221; and second using &#8220;Import SOAP&#8221; buttons from toolbar.</p>
<p>Click on &#8220;Add Service Call&#8221;. In &#8220;Operation&#8221; dropdown list select value &#8220;getItemById&#8221;. On left side select &#8220;id&#8221; under Input Arguments tree node. Then on right side type &#8220;1&#8243; into Value editbox. </p>
<p><img src="http://blog.testsautomation.com/wp-content/uploads/2009/07/3.jpg" alt="3" title="3" width="516" height="508" class="aligncenter size-full wp-image-297" /></p>
<p>Now our script should look like this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">Action<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;web_service_call<span class="br0">&#40;</span> <span class="st0">&quot;StepName=getItemById_101&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;SOAPMethod=Cart|ICart|getItemById&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;ResponseParam=response&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;Service=Cart&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;ExpectedResponse=SoapResult&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;Snapshot=t1248415874.inf&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;BEGIN_ARGUMENTS,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;id=1&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;END_ARGUMENTS,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;BEGIN_RESULT,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;END_RESULT,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;LAST<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="kw1">return</span> <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<p>Now lets add Web Service request using Import SOAP. Lets assume we have XML request saved in file on the disk. Here is an example:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;?xml</span> <span class="re0">version</span>=<span class="st0">&quot;1.0&quot;</span> <span class="re0">encoding</span>=<span class="st0">&quot;UTF-8&quot;</span><span class="re2">?&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;SOAP-ENV:Envelope</span> <span class="re0">xmlns:SOAP-ENV</span>=<span class="st0">&quot;http://schemas.xmlsoap.org/soap/envelope/&quot;</span> <span class="re0">xmlns:xsd</span>=<span class="st0">&quot;http://www.w3.org/2001/XMLSchema&quot;</span> <span class="re0">xmlns:xsi</span>=<span class="st0">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="sc3"><span class="re1">&lt;SOAP-ENV:Body<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;getItemByTitle</span> <span class="re0">xmlns</span>=<span class="st0">&quot;http://www.parasoft.com/wsdl/store-01/&quot;</span><span class="re2">&gt;</span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;<span class="sc3"><span class="re1">&lt;titleKeyword<span class="re2">&gt;</span></span></span>Linux<span class="sc3"><span class="re1">&lt;/titleKeyword<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; <span class="sc3"><span class="re1">&lt;/getItemByTitle<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1">&nbsp;<span class="sc3"><span class="re1">&lt;/SOAP-ENV:Body<span class="re2">&gt;</span></span></span></div>
</li>
<li class="li1">
<div class="de1"><span class="sc3"><span class="re1">&lt;/SOAP-ENV:Envelope<span class="re2">&gt;</span></span></span></div>
</li>
</ol>
</div>
</div>
<p>Click &#8220;Import SOAP&#8221; button and select your file. Change type from &#8220;Web Service Call (Recommended)&#8221; to &#8220;SOAP Request&#8221;. Select URL from the list, and type into SOAPAction this value &#8220;getItemByTitle&#8221;. Click OK.<br />
Now we&#8217;ve added second call that ask for book details for title &#8220;Linux&#8221;. Our script should look like this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">Action()</div>
</li>
<li class="li1">
<div class="de1">{</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;web_service_call( &quot;StepName=getItemById_101&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;SOAPMethod=Cart|ICart|getItemById&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;ResponseParam=response&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;Service=Cart&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;ExpectedResponse=SoapResult&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;Snapshot=t1248415874.inf&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;BEGIN_ARGUMENTS,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &quot;id=1&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; END_ARGUMENTS,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; BEGIN_RESULT,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; END_RESULT,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;LAST);</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;soap_request(&quot;StepName=SOAP Request&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;URL=http://ws1.parasoft.com/glue/store-01&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;SOAPEnvelope=&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;?xml</span> <span class="re0">version</span>=\<span class="st0">&quot;1.0\&quot;</span> <span class="re0">encoding</span>=\<span class="st0">&quot;UTF-8\&quot;</span><span class="re2">?&gt;</span></span>&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;SOAP-ENV:Envelope</span> <span class="re0">xmlns:SOAP-ENV</span>=\<span class="st0">&quot;http://schemas.xmlsoap.org/soap/envelope/\&quot;</span> <span class="re0">xmlns:xsd</span>=\<span class="st0">&quot;http://www.w3.org/2001/XMLSchema\&quot;</span> <span class="re0">xmlns:xsi</span>=\<span class="st0">&quot;http://www.w3.org/2001/XMLSchema-instance\&quot;</span><span class="re2">&gt;</span></span>&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;SOAP-ENV:Body<span class="re2">&gt;</span></span></span>&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;getItemByTitle</span> <span class="re0">xmlns</span>=\<span class="st0">&quot;http://www.parasoft.com/wsdl/store-01/\&quot;</span><span class="re2">&gt;</span></span>&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;titleKeyword<span class="re2">&gt;</span></span></span>Linux<span class="sc3"><span class="re1">&lt;/titleKeyword<span class="re2">&gt;</span></span></span>&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;/getItemByTitle<span class="re2">&gt;</span></span></span>&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;/SOAP-ENV:Body<span class="re2">&gt;</span></span></span>&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;/SOAP-ENV:Envelope<span class="re2">&gt;</span></span></span>&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;SOAPAction=getItemByTitle&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;ResponseParam=response&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;Snapshot=t1248416271.inf&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;LAST);</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;return 0;</div>
</li>
<li class="li1">
<div class="de1">}</div>
</li>
</ol>
</div>
</div>
<p>As you can see, each request contain &#8220;ResponseParam=response&#8221;. LoadRunner will automatically save response XML into parameter with name &#8220;response&#8221;. We can easily display this parameter by addind </p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">lr_message<span class="br0">&#40;</span>lr_eval_string<span class="br0">&#40;</span><span class="st0">&quot;Response XML is <span class="es0">\n</span>{response}&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
</div>
<p>after each call. So at the end out script should look like this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">Action()</div>
</li>
<li class="li1">
<div class="de1">{</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;web_service_call( &quot;StepName=getItemById_101&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;SOAPMethod=Cart|ICart|getItemById&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;ResponseParam=response&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;Service=Cart&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;ExpectedResponse=SoapResult&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;Snapshot=t1248415874.inf&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;BEGIN_ARGUMENTS,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &quot;id=1&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; END_ARGUMENTS,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; BEGIN_RESULT,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; END_RESULT,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;&nbsp; &nbsp; &nbsp;LAST);</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;lr_message(lr_eval_string(&quot;Response XML is \n{response}&quot;));</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;soap_request(&quot;StepName=SOAP Request&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;URL=http://ws1.parasoft.com/glue/store-01&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;SOAPEnvelope=&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;?xml</span> <span class="re0">version</span>=\<span class="st0">&quot;1.0\&quot;</span> <span class="re0">encoding</span>=\<span class="st0">&quot;UTF-8\&quot;</span><span class="re2">?&gt;</span></span>&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;SOAP-ENV:Envelope</span> <span class="re0">xmlns:SOAP-ENV</span>=\<span class="st0">&quot;http://schemas.xmlsoap.org/soap/envelope/\&quot;</span> <span class="re0">xmlns:xsd</span>=\<span class="st0">&quot;http://www.w3.org/2001/XMLSchema\&quot;</span> <span class="re0">xmlns:xsi</span>=\<span class="st0">&quot;http://www.w3.org/2001/XMLSchema-instance\&quot;</span><span class="re2">&gt;</span></span>&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;SOAP-ENV:Body<span class="re2">&gt;</span></span></span>&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;getItemByTitle</span> <span class="re0">xmlns</span>=\<span class="st0">&quot;http://www.parasoft.com/wsdl/store-01/\&quot;</span><span class="re2">&gt;</span></span>&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;titleKeyword<span class="re2">&gt;</span></span></span>Linux<span class="sc3"><span class="re1">&lt;/titleKeyword<span class="re2">&gt;</span></span></span>&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;/getItemByTitle<span class="re2">&gt;</span></span></span>&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;/SOAP-ENV:Body<span class="re2">&gt;</span></span></span>&quot;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;<span class="sc3"><span class="re1">&lt;/SOAP-ENV:Envelope<span class="re2">&gt;</span></span></span>&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;SOAPAction=getItemByTitle&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;ResponseParam=response&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;&quot;Snapshot=t1248416271.inf&quot;,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;LAST);</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;lr_message(lr_eval_string(&quot;Response XML is \n{response}&quot;));</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp;return 0;</div>
</li>
<li class="li1">
<div class="de1">}</div>
</li>
</ol>
</div>
</div>
<p>At the end lets run our script. Output should be something like this:</p>
<p><img src="http://blog.testsautomation.com/wp-content/uploads/2009/07/4.jpg" alt="4" title="4" width="887" height="763" class="aligncenter size-full wp-image-307" /></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2009/07/web-services-testing-in-loadrunner/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Validating Web Service response with XPath</title>
		<link>http://blog.testsautomation.com/2009/05/validating-web-service-response-with-xpath/</link>
		<comments>http://blog.testsautomation.com/2009/05/validating-web-service-response-with-xpath/#comments</comments>
		<pubDate>Mon, 18 May 2009 15:34:04 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[web service]]></category>
		<category><![CDATA[xml]]></category>
		<category><![CDATA[xpath]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=255</guid>
		<description><![CDATA[The easiest way for checking web service response in HP LoadRunner is by using XPath query language. LR API contains few functions designed especially for dealing with XML. 




lr_xml_get_values&#40;&#41; &#160;//Retrieves values of XML elements found by a query


lr_xml_set_values&#40;&#41; &#160;//Sets the values of XML elements found by a query


lr_xml_extract&#40;&#41; &#160;//Extracts XML string fragments from an XML [...]]]></description>
			<content:encoded><![CDATA[<p>The easiest way for checking web service response in HP LoadRunner is by using XPath query language. LR API contains few functions designed especially for dealing with XML. </p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">lr_xml_get_values<span class="br0">&#40;</span><span class="br0">&#41;</span> &nbsp;<span class="co1">//Retrieves values of XML elements found by a query</span></div>
</li>
<li class="li1">
<div class="de1">lr_xml_set_values<span class="br0">&#40;</span><span class="br0">&#41;</span> &nbsp;<span class="co1">//Sets the values of XML elements found by a query</span></div>
</li>
<li class="li1">
<div class="de1">lr_xml_extract<span class="br0">&#40;</span><span class="br0">&#41;</span> &nbsp;<span class="co1">//Extracts XML string fragments from an XML string</span></div>
</li>
<li class="li1">
<div class="de1">lr_xml_delete<span class="br0">&#40;</span><span class="br0">&#41;</span> &nbsp;<span class="co1">//Deletes fragments from an XML string</span></div>
</li>
<li class="li1">
<div class="de1">lr_xml_replace<span class="br0">&#40;</span><span class="br0">&#41;</span> &nbsp;<span class="co1">//Replaces fragments of an XML string</span></div>
</li>
<li class="li1">
<div class="de1">lr_xml_insert<span class="br0">&#40;</span><span class="br0">&#41;</span> &nbsp;<span class="co1">//Inserts a new XML fragment into an XML string</span></div>
</li>
<li class="li1">
<div class="de1">lr_xml_find<span class="br0">&#40;</span><span class="br0">&#41;</span> &nbsp;<span class="co1">//Verifies that XML values are returned by a query</span></div>
</li>
<li class="li1">
<div class="de1">lr_xml_transform<span class="br0">&#40;</span><span class="br0">&#41;</span> &nbsp;<span class="co1">//Applies Extensible Stylesheet Language (XSL) Transformation to XML data</span></div>
</li>
</ol>
</div>
</div>
<p>Now, lets say we have sample web service for on-line book store and we want to ask what is the author for book id 123. Our web service can send following XML as a response:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">&lt;books&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &lt;book&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &lt;id&gt;<span class="nu0">123</span>&lt;/id&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &lt;author&gt;John Smith&lt;/author&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &lt;title&gt;Working with Legacy code&lt;/title&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &lt;publisher&gt;Microsoft&lt;/publisher&gt;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &lt;/book&gt;</div>
</li>
<li class="li1">
<div class="de1">&lt;/books&gt;</div>
</li>
</ol>
</div>
</div>
<p>For checking if the &#8220;author&#8221; element within XML response contains &#8220;John Smith&#8221; value we will use lr_xml_get_values() function. Here is the code that calls web service and checks if the value is as expected:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">Action<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;web_add_header<span class="br0">&#40;</span><span class="st0">&quot;SOAPAction&quot;</span>, <span class="st0">&quot;<span class="es0">\&quot;</span>CallMe<span class="es0">\&quot;</span>&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;lr_start_transaction<span class="br0">&#40;</span><span class="st0">&quot;AUTHOR&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;soap_request<span class="br0">&#40;</span><span class="st0">&quot;StepName=Sample Soap Request&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;ExpectedResponse=ANY&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;URL=http://foo.com/api&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;SOAPEnvelope= &quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;&lt;?xml version=<span class="es0">\&quot;</span>1.0<span class="es0">\&quot;</span> encoding=<span class="es0">\&quot;</span>utf-8<span class="es0">\&quot;</span>?&gt;&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;&lt;soap:Envelope &quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;xmlns:soap=<span class="es0">\&quot;</span>http://schemas.xmlsoap.org/soap/envelope/<span class="es0">\&quot;</span> &gt;&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;&lt;soap:Body soap:encodingStyle=<span class="es0">\&quot;</span>http://schemas.xmlsoap.org/soap/encoding/<span class="es0">\&quot;</span>&gt;&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;&lt;GetBookDetails&gt;&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;&lt;idValue&gt;123&lt;/idValue&gt;&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;&lt;/GetBookDetails&gt;&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;&lt;/soap:Body&gt;&quot;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;&lt;/soap:Envelope&gt;&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;Snapshot=t765765765.inf&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp;<span class="st0">&quot;ResponseParam=Response_Xml&quot;</span>,LAST<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;lr_xml_get_values<span class="br0">&#40;</span><span class="st0">&quot;XML={Response_Xml}&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;ValueParam=Author_Name&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; <span class="st0">&quot;Query=/books/book/author&quot;</span>,</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; LAST<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;lr_output_message<span class="br0">&#40;</span>lr_eval_string<span class="br0">&#40;</span><span class="st0">&quot;Author is = {Author_Name}&quot;</span><span class="br0">&#41;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="kw1">if</span><span class="br0">&#40;</span>strcmp<span class="br0">&#40;</span>lr_eval_string<span class="br0">&#40;</span><span class="st0">&quot;{Author_Name}&quot;</span><span class="br0">&#41;</span>,<span class="st0">&quot;John Smith&quot;</span><span class="br0">&#41;</span> == <span class="nu0">0</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;lr_end_transaction<span class="br0">&#40;</span><span class="st0">&quot;AUTHOR&quot;</span>, LR_PASS<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="kw1">else</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;&nbsp; &nbsp;lr_end_transaction<span class="br0">&#40;</span><span class="st0">&quot;AUTHOR&quot;</span>, LR_FAIL<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="br0">&#125;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp;<span class="kw1">return</span> <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<p>First argument in lr_xml_get_values() call is parameter name that holds response XML. Second argument in name of new parameter that will hold author value extracted from response XML. Third argument is XPath query that extracts author element value.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2009/05/validating-web-service-response-with-xpath/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>IP Spoofing with LoadRunner</title>
		<link>http://blog.testsautomation.com/2009/04/ip-spoofing-with-loadrunner/</link>
		<comments>http://blog.testsautomation.com/2009/04/ip-spoofing-with-loadrunner/#comments</comments>
		<pubDate>Thu, 23 Apr 2009 18:40:24 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[load runner]]></category>
		<category><![CDATA[spoofing]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=242</guid>
		<description><![CDATA[As described here ip spoofing is a technique for hiding real identity of the attacker on the net. It is mainly used for hacking but it can be helpful for performance tests as well. 
Let’s say we have some fancy network infrastructure that cache some of our requests in the performance test. Because of that [...]]]></description>
			<content:encoded><![CDATA[<p>As described <a href="http://www.securityfocus.com/infocus/1674">here</a> ip spoofing is a technique for hiding real identity of the attacker on the net. It is mainly used for hacking but it can be helpful for performance tests as well. </p>
<p>Let’s say we have some fancy network infrastructure that cache some of our requests in the performance test. Because of that our results may be incorrect. To omit this issue we can change the IP address of each (e.g. HTTP) request that reaches the server and simulate load from multiple users not only on the application level but on the network level as well. In that case cache won’t affect performance tests. Fortunately folks from Mercury/HP implemented special function for IP spoofing in LoadRunner API.</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">lr_enable_ip_spoofing<span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&#8230;</div>
</li>
<li class="li1">
<div class="de1"><span class="me1">lr_disable_ip_spoofing</span><span class="br0">&#40;</span><span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
</div>
<p>To use it, first put your code between these to functions calls.<br />
Second (before connecting to load generator!!!) enable IP Spoofer option in LR Controller (Scenario > Enable IP Spoofer).</p>
<p>Let the hacking begin <img src='http://blog.testsautomation.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Tip:<br />
There is an option in Controller (in Expert mode) to choose between multiple IP addresses per process or per thread (Tools > Options).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2009/04/ip-spoofing-with-loadrunner/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>Don&#8217;t waste your time</title>
		<link>http://blog.testsautomation.com/2009/04/dont-waste-your-time/</link>
		<comments>http://blog.testsautomation.com/2009/04/dont-waste-your-time/#comments</comments>
		<pubDate>Sun, 19 Apr 2009 21:57:34 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[load runner]]></category>
		<category><![CDATA[performance]]></category>
		<category><![CDATA[wasted time]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=202</guid>
		<description><![CDATA[Waste time in Load Runner is a time spend on tasks that normal browser user wouldn&#8217;t perform like storing test results, performance monitoring, calculations, etc. Wasted time is measured by LR automatically but sometimes it is necessary to use it explicitly through lr_wasted_time() function . 
lr_wasted_times() removes time from all open transaction. If you want [...]]]></description>
			<content:encoded><![CDATA[<p>Waste time in Load Runner is a time spend on tasks that normal browser user wouldn&#8217;t perform like storing test results, performance monitoring, calculations, etc. Wasted time is measured by LR automatically but sometimes it is necessary to use it explicitly through lr_wasted_time() function . </p>
<p>lr_wasted_times() removes time from all open transaction. If you want to make some calculation and don&#8217;t count them into overall transaction time then you should use this function.</p>
<p>Small example</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1">Action<span class="br0">&#40;</span><span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#123;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; merc_timer_handle_t timer; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">long</span> i;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw4">double</span> wastedTime;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; lr_start_transaction<span class="br0">&#40;</span><span class="st0">&quot;My_Transaction&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; timer = lr_start_timer<span class="br0">&#40;</span><span class="br0">&#41;</span>; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">for</span><span class="br0">&#40;</span>i = <span class="nu0">0</span>; i &lt; <span class="nu0">1000</span>; i++<span class="br0">&#41;</span></div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; lr_message<span class="br0">&#40;</span><span class="st0">&quot;%d<span class="es0">\n</span>&quot;</span>, i<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; wastedTime = lr_end_timer<span class="br0">&#40;</span>timer<span class="br0">&#41;</span>; </div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; wastedTime*=<span class="nu0">1000</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; lr_wasted_time<span class="br0">&#40;</span>wastedTime<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; lr_end_transaction<span class="br0">&#40;</span><span class="st0">&quot;My_Transaction&quot;</span>, LR_AUTO<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; lr_message<span class="br0">&#40;</span><span class="st0">&quot;Wasted %lf milliseconds&quot;</span>, wastedTime<span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp; &nbsp; &nbsp; &nbsp; <span class="kw1">return</span> <span class="nu0">0</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<p>On line 7 I&#8217;m starting one transaction. On line 8 I&#8217;m starting timer and stoping it at line 11. For loop between is used to generate my wasted time. After stopping the time, we need to subtract wasted time from open transaction by calling lr_wasted_time() on line 14. But before that on line 12 we need to change time units. lr_end_timer() returns time in seconds but lr_wasted_time() takes time in milliseconds. Thats why we need to multiply it by 1000. There is one more think. lr_wasted_time() is defined as </p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="kw4">void</span> lr_wasted_time <span class="br0">&#40;</span><span class="kw4">long</span> wasteTime<span class="br0">&#41;</span>;</div>
</li>
</ol>
</div>
</div>
<p>If you use long type variable to measure wasted time you will always get rounded results (e.g. 1000, 2000, 3000). Instead it is better to use double type variable so at the end the results are more precise. </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2009/04/dont-waste-your-time/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Running LoadRunner scenarios from QualityCenter automatically</title>
		<link>http://blog.testsautomation.com/2009/02/running-loadrunner-scenarios-from-qualitycenter-automatically/</link>
		<comments>http://blog.testsautomation.com/2009/02/running-loadrunner-scenarios-from-qualitycenter-automatically/#comments</comments>
		<pubDate>Wed, 25 Feb 2009 22:36:09 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[quality center]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=167</guid>
		<description><![CDATA[There is a very nice tool provided by HP Support that allows running few LoadRunner scenarios from QualityCenter using command line. You can use it to run load tests in regression every night for example. 
Officially HP doesn&#8217;t support this small tool and they say it&#8217;s free and open source. There are two versions available. [...]]]></description>
			<content:encoded><![CDATA[<p>There is a very nice tool provided by HP Support that allows running few LoadRunner scenarios from QualityCenter using command line. You can use it to run load tests in regression every night for example. </p>
<p>Officially HP doesn&#8217;t support this small tool and they say it&#8217;s free and open source. There are two versions available. One for QC 9.0 and another for QC 8.2 SP1. If you want to find it on HP support page, just search for document ID KM191021.</p>
<p><a href="http://testsautomation.com/CPT38343A.zip">cpt38343a</a> &#8211; this is my local mirror for QC 9.0 version</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2009/02/running-loadrunner-scenarios-from-qualitycenter-automatically/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
