<?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/tag/loadrunner/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.testsautomation.com</link>
	<description>Live fast, die old...</description>
	<lastBuildDate>Mon, 02 Jan 2012 20:36:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>How to debug LoadRunner script</title>
		<link>http://blog.testsautomation.com/2010/12/how-to-debug-loadrunner-script/</link>
		<comments>http://blog.testsautomation.com/2010/12/how-to-debug-loadrunner-script/#comments</comments>
		<pubDate>Thu, 16 Dec 2010 11:59:31 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[breakpoint]]></category>
		<category><![CDATA[debug]]></category>
		<category><![CDATA[script]]></category>
		<category><![CDATA[settings]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=613</guid>
		<description><![CDATA[From time to time there are situations where you work on a script, and it looks fine, compiles with no issues but simply doesn&#8217;t work as you expect. In such case there is no other option than just knuckle down and get a little bit dirty. That&#8217;s the right time for debugging. And here some [...]]]></description>
			<content:encoded><![CDATA[<p>From time to time there are situations where you work on a script, and it looks fine, compiles with no issues but simply doesn&#8217;t work as you expect. In such case there is no other option than just knuckle down and get a little bit dirty. That&#8217;s the right time for debugging.</p>
<p>And here some tips from me that (hopefully) will help you making this step less painful. </p>
<p><strong>1) Increase log level</strong><br />
By default, VuGen report only standard information. If you want to see more verbose details, then go to Vuser -> Run-Time settings -> Log and enable &#8220;Extended log&#8221; option.</p>
<p><img src="http://blog.testsautomation.com/wp-content/uploads/2010/12/lr_prop.jpg" alt="lr_prop" title="lr_prop" width="504" height="374" class="aligncenter size-full wp-image-621" /></p>
<p><strong>2) Use HTTP Proxy</strong><br />
Another option is to find by checking what exactly LoadRunner sends to the server. Personally I use WebScarab and Fidler (from time to time) to sniff network traffic and to check what data my script generate. You can setup proxy in VuGen by going to Vuser -> Run-Time settings -> Proxy.</p>
<p>Below is a setup for WebScarab running locally:</p>
<p><img src="http://blog.testsautomation.com/wp-content/uploads/2010/12/lr_webscarab_setup.jpg" alt="lr_webscarab_setup" title="lr_webscarab_setup" width="576" height="426" class="aligncenter size-full wp-image-630" /></p>
<p>and sample traffic as seen in WebScarab:</p>
<p><img src="http://blog.testsautomation.com/wp-content/uploads/2010/12/webscarab_sample_session1.jpg" alt="webscarab_sample_session" title="webscarab_sample_session" width="642" height="435" class="aligncenter size-full wp-image-670" /></p>
<p><strong>3) Use text tools to compare HTTP requests from LR and from real browser</strong><br />
Lets say you sniffed LR HTTP call and browser HTTP call e.g. with local proxy and you want to compare both to search for any differences. Sometimes your HTTP call fails only because of e.g. missing dot somewhere. And such bugs are even harder to find because there is no obvious &#8220;Hello, I&#8217;m here&#8221; error type of message. Try to use Notepad+ or ConTEXT (http://www.contexteditor.org). </p>
<p>Sample results of HTTP requests comparison in ConTEXT editor:</p>
<p><img src="http://blog.testsautomation.com/wp-content/uploads/2010/12/compare_results1.jpg" alt="compare_results" title="compare_results" width="719" height="282" class="aligncenter size-full wp-image-645" /></p>
<p><strong>4) Use breakpoint</strong><br />
Breakpoint is a place in script where LR will pause running so you can see all runtime values. Howto setup a breakpoint? Simply right click line where you would like to pause and select &#8220;Toggle Breakpoint&#8221;. This will put red dot at the beginning of line. It looks like that:</p>
<p><img src="http://blog.testsautomation.com/wp-content/uploads/2010/12/breakpoint.jpg" alt="breakpoint" title="breakpoint" width="464" height="357" class="aligncenter size-full wp-image-648" /></p>
<p>Now, simply start the script, and wait until script reaches this breakpoint. When it&#8217;s done, in output window you can switch to &#8220;RunTime Data&#8221; and see detailed information like which iteration is running currently, which action, line number and (most interesting) all parameter with their current values:</p>
<p><img src="http://blog.testsautomation.com/wp-content/uploads/2010/12/breakpoint_pause.jpg" alt="breakpoint_pause" title="breakpoint_pause" width="554" height="163" class="aligncenter size-full wp-image-650" /></p>
<p>To resume running, simply hit run button once again. To disable a break point, also right click the line and select the same &#8220;Toggle Breakpoint&#8221;.</p>
<p><strong>5) Run script step by step</strong><br />
Running step by step means that instead of going from one call to another automatically, you need to hit F10 in order to perform next call. This is actually helpful when running with Browser preview or when you have lots of if/while/do&#8230;while/for loops and you want to see exactly what LR is doing and where.<br />
To run scrip in step by step mode you just simply hit F10 or select Vuser -> Run Step by Step.</p>
<p><strong>6) Force script to run with specific parameters values</strong><br />
This is actually a trick, definitely not something described in VuGen manual. Lets say your script use parameters very heavily and depends on them as well. Now, you have e.g. parameter USERNAME with lots of accounts to use but you want to use one very specific account. One method is to update/change the parameter so it will pick up correct account. But in such case you need to remember to undo your changes after you are done with the test. Another method is to leave parameter unchanged, and just override it&#8217;s value during runtime. For that you can use lr_save_string() function and place it somewhere at the beginning.</p>
<p>One could say that it&#8217;s even more dangerous than first method since it always overrides param value so when left unchanged could fail every future load test. But even for than there is a solution. Trick that I use looks like this:</p>
<div class="codesnip-container" >
<div class="codesnip" style="font-family: monospace;">
<ol>
<li class="li1">
<div class="de1"><span class="kw4">int</span> id;</div>
</li>
<li class="li1">
<div class="de1">lr_whoami<span class="br0">&#40;</span>&amp;id, <span class="kw2">NULL</span>, <span class="kw2">NULL</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1">&nbsp;</div>
</li>
<li class="li1">
<div class="de1"><span class="kw1">if</span><span class="br0">&#40;</span>id &lt; <span class="nu0">0</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; lr_save_string<span class="br0">&#40;</span><span class="st0">&quot;Pete&quot;</span>, <span class="st0">&quot;USERNAME&quot;</span><span class="br0">&#41;</span>;</div>
</li>
<li class="li1">
<div class="de1"><span class="br0">&#125;</span></div>
</li>
</ol>
</div>
</div>
<p>And basically you can leave it in your script because LR will reach this lr_save_string call only in VuGen. When running in LR Controller, lr_save_string() won&#8217;t be reached (lr_whoami called in VuGen always return -1).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2010/12/how-to-debug-loadrunner-script/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 [...]]]></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>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 [...]]]></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>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 [...]]]></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>0</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>0</slash:comments>
		</item>
		<item>
		<title>IBM WebSphere MQ testing using LoadRunner</title>
		<link>http://blog.testsautomation.com/2009/02/ibm-websphere-mq-testing-using-loadrunner/</link>
		<comments>http://blog.testsautomation.com/2009/02/ibm-websphere-mq-testing-using-loadrunner/#comments</comments>
		<pubDate>Mon, 23 Feb 2009 20:09:10 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[IBM WebSphere MQ]]></category>
		<category><![CDATA[JMS]]></category>
		<category><![CDATA[web services]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=113</guid>
		<description><![CDATA[My first script for WebSphere MQ testing was written in Java as Java Vuser script. It was pretty simple since I was using just MQ JMS API.  There is lots of examples howto connect to WebSphere in Java. Here is one http://hursleyonwmq.wordpress.com/2007/05/29/simplest-sample-applications-using-websphere-mq-jms/. But howto test WebSphere MQ if you don&#8217;t have Java license in you [...]]]></description>
			<content:encoded><![CDATA[<p>My first script for WebSphere MQ testing was written in Java as Java Vuser script. It was pretty simple since I was using just MQ JMS API.  There is lots of examples howto connect to WebSphere in Java. Here is one <a title="example" href="http://hursleyonwmq.wordpress.com/2007/05/29/simplest-sample-applications-using-websphere-mq-jms/" target="_blank">http://hursleyonwmq.wordpress.com/2007/05/29/simplest-sample-applications-using-websphere-mq-jms/</a>.</p>
<p>But howto test WebSphere MQ if you don&#8217;t have Java license in you LoadRunner?</p>
<p>There is a way to do that. LoadRunner API contains several JMS functions:</p>
<p>jms_receive_message_queue()<br />
jms_send_message_queue()<br />
jms_send_receive_message_queue()<br />
jms_set_general_property()<br />
jms_set_message_property()</p>
<p>First of all you need to have &#8220;Web Services&#8221; license to use them.</p>
<p>Here is what you need to do:</p>
<ul>
<li>Get details of your environment like: MQ server IP, port (probably 1414), Queue Manager name, Queue name and channel name.<br />
Install IBM WebSphere MQ Client on machine where you have LoadRunner Controller (or LoadRunner Generator if you are using remote one). MQ Windows Client for WebSphere 6.0 can be downloaded <a title="here" href="http://www-01.ibm.com/support/docview.wss?uid=swg24009961" target="_blank">here.</a></li>
</ul>
<ul>
<li>Setup details of our WebSphere MQ server on the client. We will use JNDI to store connection details (host, port, etc&#8230;)</li>
</ul>
<ul>
<li> Edit file C:\Program Files\IBM\WebSphere MQ\Java\bin\JMSAdmin.config and set</li>
</ul>
<blockquote><p>INITIAL_CONTEXT_FACTORY=com.sun.jndi.fscontext.RefFSContextFactory<br />
PROVIDER_URL=file:/C:/JNDI</p></blockquote>
<ul>
<li>Create new .scp file and put there your MQ server details. Here an example</li>
</ul>
<blockquote><p>DELETE QCF(QueueConnectionFactory)<br />
DEFINE QCF(QueueConnectionFactory) QMGR(QUEUE_MANAGER) tran(client) chan(SYSTEM.ADMIN.SVRCONN) host(192.168.12.13) port(1414)<br />
DISPLAY QCF(QueueConnectionFactory)<br />
DEFINE Q(MY_QUEUE) QUEUE(MY_QUEUE) QMGR(QUEUE_MANAGER)<br />
DISPLAY Q(MY_QUEUE)<br />
end</p></blockquote>
<ul>
<li>Last step for MQ Client is to generate .bindings file (placed automatically in C:/JNDI) with JMSAdmin tool from C:\Program Files\IBM\WebSphere MQ\Java\bin directory. Assuming that your .scp file is named My_qm.scp, use this command:</li>
</ul>
<blockquote><p>JMSAdmin &lt; My_qm.scp</p></blockquote>
<p>Now in LoadRunner:</p>
<ul>
<li> Create new Web Services script</li>
</ul>
<ul>
<li>Open Run-Time settings (F4) and go to JMS/Advanced</li>
</ul>
<ul>
<li>Change JNDI initial context factory to &#8220;com.sun.jndi.fscontext.RefFSContextFactory&#8221;</li>
</ul>
<ul>
<li>Change JNDI provider URL to &#8220;file:/C:/JNDI&#8221;</li>
</ul>
<ul>
<li>Change JMS connection factory to &#8220;QueueConnectionFactory&#8221; and click OK</li>
</ul>
<p>Use this sample code to send and receive a message from IBM WebSphere MQ:</p>
<pre lang="JAVA">//setting JMS message property JmsMessageID
jms_set_message_property("JMSMessageID","JMSMessageID", "12345");

//sending message
jms_send_message_queue("Sending message","My cool message", "MY_QUEUE");

//receiving message
jms_receive_message_queue("Receiving message", "MY_QUEUE");

//displaying message
lr_message(lr_eval_string("{JMS_message}"));</pre>
<p>Received message is saved in &#8220;JMS_message&#8221; parameter automatically by LoadRunner.</p>
<p>Done. Smart and simple <img src='http://blog.testsautomation.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2009/02/ibm-websphere-mq-testing-using-loadrunner/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How to crash LoadRunner 9.0 in 5 steps</title>
		<link>http://blog.testsautomation.com/2009/01/how-to-crash-loadrunner-90-in-5-steps/</link>
		<comments>http://blog.testsautomation.com/2009/01/how-to-crash-loadrunner-90-in-5-steps/#comments</comments>
		<pubDate>Wed, 14 Jan 2009 23:14:40 +0000</pubDate>
		<dc:creator>Waldemar</dc:creator>
				<category><![CDATA[LoadRunner]]></category>
		<category><![CDATA[Controller]]></category>
		<category><![CDATA[crash]]></category>

		<guid isPermaLink="false">http://blog.testsautomation.com/?p=8</guid>
		<description><![CDATA[I&#8217;ve found it during playing with latest LR version. Steps to reproduce: Open controller Create new goal oriented scenario edit goal type and select “Virtual Users” goal set 0 (zero) as amount of Vusers to reach click OK Done. LR crashes without any error message, without completely anything. And I thought  boundary value testing is [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve found it during playing with latest LR version. Steps to reproduce:</p>
<ul>
<li>Open controller</li>
<li>Create new goal oriented scenario</li>
<li>edit goal type and select “Virtual Users” goal</li>
<li>set 0 (zero) as amount of Vusers to reach</li>
<li>click OK</li>
</ul>
<p>Done. LR crashes without any error message, without completely anything. And I thought  boundary value testing is something basic&#8230; :/</p>
<p>P.S. This bug is already reported to HP.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.testsautomation.com/2009/01/how-to-crash-loadrunner-90-in-5-steps/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

