<?xml version='1.0' encoding='UTF-8'?><?xml-stylesheet href="http://www.blogger.com/styles/atom.css" type="text/css"?><feed xmlns='http://www.w3.org/2005/Atom' xmlns:openSearch='http://a9.com/-/spec/opensearchrss/1.0/' xmlns:blogger='http://schemas.google.com/blogger/2008' xmlns:georss='http://www.georss.org/georss' xmlns:gd="http://schemas.google.com/g/2005" xmlns:thr='http://purl.org/syndication/thread/1.0'><id>tag:blogger.com,1999:blog-7247480733244728924</id><updated>2025-11-23T13:35:22.501+00:00</updated><category term="automation"/><category term="Load testing"/><category term="Performance testing"/><category term="VBscript"/><category term="RPT"/><category term="Rational Performance tester"/><category term="Selenium"/><category term="Quality Center"/><category term="Testing"/><category term="examples"/><category term="tutorial"/><category term="webDriver"/><category term="C#"/><category term="Test Management"/><category term="nUnit"/><category term="Batch Run utility"/><category term="Excel Reports"/><category term="QTP"/><category term="Commandline"/><category term="Certification"/><category term="Custom code"/><category term="Defect"/><category term="QC Connection"/><category term="TestNG"/><category term="ANT"/><category term="Actions"/><category term="Add Libraries"/><category term="Correlation"/><category term="Datapool"/><category term="FIREWALL"/><category term="Functions"/><category term="Java"/><category term="Loadrunner"/><category term="Pattern matching"/><category term="Recovery Scenario"/><category term="SpecFlow"/><category term="Test log"/><category term="TestCase"/><category term="jMeter"/><title type='text'>Software Engineering - Performance Automation</title><subtitle type='html'></subtitle><link rel='http://schemas.google.com/g/2005#feed' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/posts/default'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/'/><link rel='hub' href='http://pubsubhubbub.appspot.com/'/><link rel='next' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default?start-index=26&amp;max-results=25'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><generator version='7.00' uri='http://www.blogger.com'>Blogger</generator><openSearch:totalResults>40</openSearch:totalResults><openSearch:startIndex>1</openSearch:startIndex><openSearch:itemsPerPage>25</openSearch:itemsPerPage><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-3565922809617850193</id><published>2013-10-19T20:14:00.001+01:00</published><updated>2013-10-19T22:11:56.755+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="automation"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="Selenium"/><category scheme="http://www.blogger.com/atom/ns#" term="SpecFlow"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="webDriver"/><title type='text'>Basic SpecFlow Automation tests in visual studio express using C# ,Selenium webdriver,nUnit console</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Specflow is layer that would sit on the top of C# and one can specify tests cases in normal English readable format and build automation using these test cases. Writing test cases in format that is easily readable enables appropriate reporting and the direct mapping user story into automated test cases.Instead of digging down what test case is doing, here from reading the test case itself, it gives understanding of what it is about and what it is doing. Thus enables one to describe a test case on how the desired behaviour should be specified.&amp;nbsp; &lt;br /&gt;
Using above&amp;nbsp; behaviour specification structure one can write a story like &lt;br /&gt;
&lt;strong&gt;Feature: Google Search&lt;br /&gt;As an end user,&lt;br /&gt;I would like to visit the google search page&lt;br /&gt;And then I would like to search an item so that&lt;br /&gt;I can view the search results&lt;/strong&gt;&lt;br /&gt;
&lt;strong&gt;Scenario: Google Search&lt;br /&gt;Given I am on the Google home page&lt;br /&gt;When I search for text Webdriver&lt;br /&gt;Then I should see the search results with title WebDriver – Google Search&lt;/strong&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Now the above defined test cases needs to glued to test automation code such that each of above Given When Then steps would get executed and make appropriate calls to application (browser here). Specflow helps to achieve this gluing of the code to BDD structure test cases. Lets see how we can do this using C#, selenium webdriver and nUnit. If you have not done setup of these tools, in my previous blogs I had describe &lt;a href=&quot;http://qtp-automate.blogspot.com/2013/05/how-to-setup-cnunit-and-selenium-client.html&quot; target=&quot;_blank&quot;&gt;how to setup Visual studio express with nUnit, selenium&lt;/a&gt; (or refer my another blog where I have explained &lt;a href=&quot;http://qtp-automate.blogspot.com/2013/10/how-to-invoke-different-type-of-web.html&quot; target=&quot;_blank&quot;&gt;how to install NuGet and download selenium/nunit etc&lt;/a&gt;)and &lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/05/creating-basic-selenium-web-driver-test.html&quot; target=&quot;_blank&quot;&gt;how to create basic script&lt;/a&gt;. You can refer these blogs if you have not done the setup and want primary understanding on Selenium/C# and nUnit work together. &lt;br /&gt;
&lt;h2&gt;
1. Setting up specflow and generate C# file having gluing code&lt;/h2&gt;
Download Specflow binaries from &lt;a href=&quot;https://github.com/techtalk/SpecFlow/downloads&quot;&gt;https://github.com/techtalk/SpecFlow/downloads&lt;/a&gt; which will have name in form of Specflow_V&amp;lt;versionnumber&amp;gt;_bin.Zip. Extract this file into location like “C:\Data\seleniumCsharp\”. Once extracted, we can now add the path of binary exe file in PATH variable of windows environment. For this go to Start –&amp;gt; Rightclick on Computer –&amp;gt; Select properties. Next Click on Advance settings . If you are using windows 7, you will be prompted to enter admin password. Next click on Environment variables.&amp;nbsp; Under System variables edit the PATH variable by&amp;nbsp; appending the path something like “C:\Data\seleniumCsharp\SpecFlow_v1.9.0_bin\tools\” with semi colons as separator&lt;br /&gt;
After this open a new command window and enter specflow and then you should see following output in command window&amp;nbsp; which confirms specflow exe is been located using system PATH&lt;br /&gt;
&lt;em&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;C:\&amp;gt;SpecFlow&lt;br /&gt;usage: specflow &amp;lt;subcommand&amp;gt; [args]&lt;br /&gt;Type &#39;specflow help &amp;lt;subcommand&amp;gt;&#39; for help on a specific subcommand.&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
&lt;em&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;Available subcommands:&lt;br /&gt;generateall - Generate tests from all feature files in a project&lt;br /&gt;stepdefinitionreport - Generates a report about usage and binding of steps&lt;br /&gt;nunitexecutionreport - Formats an NUnit execution report to SpecFlow style&lt;br /&gt;mstestexecutionreport - Formats an MsTest execution report to SpecFlow style&lt;/span&gt;&lt;/em&gt;&lt;em&gt;&lt;span style=&quot;font-family: Calibri; font-size: x-small;&quot;&gt;&lt;br /&gt;&lt;/span&gt;&lt;/em&gt;&lt;br /&gt;
From above output , there are two subcommands which we are interested&amp;nbsp; - generateall and nunitexecutionreport. Using subcommand generateall lets try to create step definition class file in C#.&amp;nbsp; &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Go to Visual studio express(if you dont have one download it from &lt;a href=&quot;http://www.microsoft.com/visualstudio/eng/downloads#d-express-windows-desktop&quot;&gt;Download Visual studio express for Windows Desktop&lt;/a&gt;), and create file –New project – SpecflowTutorial. &lt;/li&gt;
&lt;li&gt;Open a new project of type Class library. Open Tools –&amp;gt;Library Package Manager Console &amp;gt; Package Manager Console to open NuGet. In the powershell command window type following command to download the packages 
&lt;blockquote&gt;
Install-Package SpecFlow&lt;br /&gt;
Install-Package SpecFlow.NUnit&lt;br /&gt;
Install-Package Selenium.WebDriver&lt;br /&gt;
Install-Package Selenium.Support&lt;br /&gt;
If you do not have NuGet refer my previous blog where I have explained &lt;a href=&quot;http://qtp-automate.blogspot.com/2013/10/how-to-invoke-different-type-of-web.html&quot; target=&quot;_blank&quot;&gt;how to install NuGet and download selenium/nunit etc&lt;/a&gt;&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;Next copy the feature and scenario marked in bold into a txt file and rename its extenstion from “.txt” to “.feature” (for example Google.feature). Save this file in project directory which is same location as .csproj file is stored for your project. Then in solution explorer of VS Express add this file by right clicking project –&amp;gt; Add –&amp;gt; Existing item. Change the filter to All files and you should see the new feature file. Then select the file and click add. Next save the project as SpecflowTutorial. &lt;/li&gt;
&lt;li&gt;First I will show you how to create a step definition file using the specflow command and then we can create a batch file that can be executed from external tools which helps us to generate step definitions in just one click.&amp;nbsp; Navigate to project directory where your .csproj and .feature files are stored and copy the path. &lt;/li&gt;
&lt;li&gt;Next open a command window and type&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
specflow generateall &amp;lt;ProjectPath&amp;gt;\&amp;lt;Projectname.csproj&amp;gt; /force /verbose &lt;br /&gt;
where &amp;lt;Project Path&amp;gt; is the path that you copied in previous step and &amp;lt;Projectname.csproj&amp;gt; is the name of the project and click enter. You should get following output in command window&lt;/blockquote&gt;
&lt;blockquote&gt;
Processing project: SpecflowTutorial&lt;br /&gt;
Google.feature -&amp;gt; test updated&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;After this click on project in solution explorer –&amp;gt; Add –&amp;gt; Existing item and select All files filter . You should see a file with same name a feature but .cs extension. Select this file and click Add. Save the project. &lt;/li&gt;
&lt;li&gt;Open up this .cs file which has feature file name a prefix (for example Google.feature.cs) and you can see a gluing code that joins the feature file. This file looks like as below.&lt;/li&gt;
&lt;/ul&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: green;&quot;&gt;// ------------------------------------------------------------------------------&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;//  &amp;lt;auto-generated&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;//      This code was generated by SpecFlow (http://www.specflow.org/).&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;//      SpecFlow Version:1.9.0.77&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;//      SpecFlow Generator Version:1.9.0.0&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;//      Runtime Version:4.0.30319.18052&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;// &lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;//      Changes to this file may cause incorrect behavior and will be lost if&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;//      the code is regenerated.&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;//  &amp;lt;/auto-generated&amp;gt;&lt;/span&gt;&lt;span style=&quot;color: green;&quot;&gt;// ------------------------------------------------------------------------------&lt;/span&gt;&lt;span style=&quot;color: #cc6633;&quot;&gt;#region&lt;/span&gt; Designer generated code
&lt;span style=&quot;color: #cc6633;&quot;&gt;#pragma&lt;/span&gt; warning disable
&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; SpecflowTutorial
{
    &lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; TechTalk.SpecFlow;
    
    
    [System.CodeDom.Compiler.GeneratedCodeAttribute(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;TechTalk.SpecFlow&quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080;&quot;&gt;&quot;1.9.0.77&quot;&lt;/span&gt;)]
    [System.Runtime.CompilerServices.CompilerGeneratedAttribute()]
    [NUnit.Framework.TestFixtureAttribute()]
    [NUnit.Framework.DescriptionAttribute(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Google Search&quot;&lt;/span&gt;)]
    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;partial&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; GoogleSearchFeature
    {
        
        &lt;span style=&quot;color: blue;&quot;&gt;private&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;static&lt;/span&gt; TechTalk.SpecFlow.ITestRunner testRunner;
        
&lt;span style=&quot;color: #cc6633;&quot;&gt;#line&lt;/span&gt; 1 &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Google.feature&quot;&lt;/span&gt;&lt;span style=&quot;color: #cc6633;&quot;&gt;#line&lt;/span&gt; hidden
        
        [NUnit.Framework.TestFixtureSetUpAttribute()]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;virtual&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; FeatureSetup()
        {
            testRunner = TechTalk.SpecFlow.TestRunnerManager.GetTestRunner();
            TechTalk.SpecFlow.FeatureInfo featureInfo = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; TechTalk.SpecFlow.FeatureInfo(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; System.Globalization.CultureInfo(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;en-US&quot;&lt;/span&gt;), &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Google Search&quot;&lt;/span&gt;, &lt;span style=&quot;color: #006080;&quot;&gt;&quot;As an end user,\r\nI would like to visit the google search page\r\nAnd then I would l&quot;&lt;/span&gt; +
                    &lt;span style=&quot;color: #006080;&quot;&gt;&quot;ike to search an item so that\r\nI can view the search results&quot;&lt;/span&gt;, ProgrammingLanguage.CSharp, ((&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[])(&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;)));
            testRunner.OnFeatureStart(featureInfo);
        }
        
        [NUnit.Framework.TestFixtureTearDownAttribute()]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;virtual&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; FeatureTearDown()
        {
            testRunner.OnFeatureEnd();
            testRunner = &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;;
        }
        
        [NUnit.Framework.SetUpAttribute()]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;virtual&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; TestInitialize()
        {
        }
        
        [NUnit.Framework.TearDownAttribute()]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;virtual&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; ScenarioTearDown()
        {
            testRunner.OnScenarioEnd();
        }
        
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;virtual&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; ScenarioSetup(TechTalk.SpecFlow.ScenarioInfo scenarioInfo)
        {
            testRunner.OnScenarioStart(scenarioInfo);
        }
        
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;virtual&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; ScenarioCleanup()
        {
            testRunner.CollectScenarioErrors();
        }
        
        [NUnit.Framework.TestAttribute()]
        [NUnit.Framework.DescriptionAttribute(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Google Search&quot;&lt;/span&gt;)]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;virtual&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; GoogleSearch()
        {
            TechTalk.SpecFlow.ScenarioInfo scenarioInfo = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; TechTalk.SpecFlow.ScenarioInfo(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Google Search&quot;&lt;/span&gt;, ((&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;[])(&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;)));
&lt;span style=&quot;color: #cc6633;&quot;&gt;#line&lt;/span&gt; 7
&lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.ScenarioSetup(scenarioInfo);
&lt;span style=&quot;color: #cc6633;&quot;&gt;#line&lt;/span&gt; 8
testRunner.Given(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;I am on the Google home page&quot;&lt;/span&gt;, ((&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;)(&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;)), ((TechTalk.SpecFlow.Table)(&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;)), &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Given &quot;&lt;/span&gt;);
&lt;span style=&quot;color: #cc6633;&quot;&gt;#line&lt;/span&gt; 9
testRunner.When(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;I search for text Webdriver&quot;&lt;/span&gt;, ((&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;)(&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;)), ((TechTalk.SpecFlow.Table)(&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;)), &lt;span style=&quot;color: #006080;&quot;&gt;&quot;When &quot;&lt;/span&gt;);
&lt;span style=&quot;color: #cc6633;&quot;&gt;#line&lt;/span&gt; 10
testRunner.Then(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;I should see the search results with title WebDriver – Google Search&quot;&lt;/span&gt;, ((&lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt;)(&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;)), ((TechTalk.SpecFlow.Table)(&lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;)), &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Then &quot;&lt;/span&gt;);
&lt;span style=&quot;color: #cc6633;&quot;&gt;#line&lt;/span&gt; hidden
            &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.ScenarioCleanup();
        }
    }
}
&lt;span style=&quot;color: #cc6633;&quot;&gt;#pragma&lt;/span&gt; warning restore
&lt;span style=&quot;color: #cc6633;&quot;&gt;#endregion&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
It is not necessary to understand the complete code for time being, but few things to point out. You can see in method name GoogleSearch(), there are method calls with name testRunner.Given, testRunner.When and testRunner.Then. The text inside these method calls is the text we need to use when we create step definitions&lt;br /&gt;
&lt;h2&gt;
2. Writing step definitions&lt;/h2&gt;
Click on Project in solution explorer and right click – &amp;gt; Add –&amp;gt; new class file. Name this class file as TutorialStepDef.cs. Then save the project.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Open the TutorialStepDef.cs add following text in the top of code to existing “Using” code lines&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
using TechTalk.SpecFlow;&lt;br /&gt;
using NUnit.Framework;&lt;br /&gt;
using OpenQA.Selenium;&lt;br /&gt;
using OpenQA.Selenium.Firefox;&lt;br /&gt;
using OpenQA.Selenium.IE;&lt;br /&gt;
using OpenQA.Selenium.Support.UI;&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Create a class name as TutorialStepDef as shown below&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
[Binding]&lt;br /&gt;
&amp;nbsp;&amp;nbsp; public class StepDefinition1&lt;br /&gt;
&amp;nbsp;&amp;nbsp; {&amp;nbsp;&amp;nbsp;&amp;nbsp; }&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Inside this class we shall write a method that binds to call “Given I am on the Google home page”. If you look at Google.feature.cs file the testrunner call has the text “I am on the Google home page” and method name as Given. This method would look like this below with attribute as [Given]. The text that is passed to Given attribute should match with the one in testruuner call of Google.feature.cs file.&lt;/li&gt;
&lt;/ul&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;blockquote&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; SpecflowTutorial
{
    [Binding]
    &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; TutorialStepDef
    {
        [Given(&lt;span style=&quot;color: #006080;&quot;&gt;@&quot;I am on the Google home page&quot;&lt;/span&gt;)]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; GivenIAmOnTheGoogleHomePage()
        {
            driver.Navigate().GoToUrl(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://www.google.com&quot;&lt;/span&gt;);
            Assert.AreEqual(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Google&quot;&lt;/span&gt;, driver.Title);
        }
    }
}&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Similarly one has to write the code to When and Then steps. The final code in TutorialStepDef .cs file is as shown below.&lt;/li&gt;
&lt;/ul&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;blockquote&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Collections.Generic;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Linq;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Text;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Threading.Tasks;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; TechTalk.SpecFlow;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; NUnit.Framework;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Firefox;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.IE;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Support.UI;

&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; SpecflowTutorial
{
    [Binding]
    &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; TutorialStepDef
    {
        IWebDriver driver = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; InternetExplorerDriver(&lt;span style=&quot;color: #006080;&quot;&gt;@&quot;C:\Data\seleniumCsharp\Drivers\&quot;&lt;/span&gt;);

        [Given(&lt;span style=&quot;color: #006080;&quot;&gt;@&quot;I am on the Google home page&quot;&lt;/span&gt;)]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; GivenIAmOnTheGoogleHomePage()
        {
            
            driver.Navigate().GoToUrl(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://www.google.com&quot;&lt;/span&gt;);
            Assert.AreEqual(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Google&quot;&lt;/span&gt;, driver.Title);
        }

        [When(&lt;span style=&quot;color: #006080;&quot;&gt;@&quot;I search for text Webdriver&quot;&lt;/span&gt;)]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; WhenISearchForATextSelenium()
        {
            &lt;span style=&quot;color: green;&quot;&gt;// Find the text input element by its name&lt;/span&gt;
            IWebElement query =driver.FindElement(By.Name(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;q&quot;&lt;/span&gt;));
            &lt;span style=&quot;color: green;&quot;&gt;// Input the search text&lt;/span&gt;
            query.SendKeys(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Webdriver&quot;&lt;/span&gt;);
            &lt;span style=&quot;color: green;&quot;&gt;// Now submit the form&lt;/span&gt;
            query.Submit();

            &lt;span style=&quot;color: green;&quot;&gt;// Google&#39;s search is rendered dynamically with JavaScript.&lt;/span&gt;
            &lt;span style=&quot;color: green;&quot;&gt;// Wait for the page to load, timeout after 5 seconds&lt;/span&gt;

            WebDriverWait wait = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; WebDriverWait(driver, TimeSpan.FromSeconds(5));
            IWebElement title = wait.Until&amp;lt;IWebElement&amp;gt;((d) =&amp;gt;
            {
                &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; d.FindElement(By.ClassName(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;ab_button&quot;&lt;/span&gt;));
            });
        }

        [Then(&lt;span style=&quot;color: #006080;&quot;&gt;@&quot;I should see the search results with title WebDriver – Google Search&quot;&lt;/span&gt;)]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; ThenIShouldSeeTheSearchResultsForSelenium()
        {
            String title = &lt;span style=&quot;color: #006080;&quot;&gt;&quot;Webdriver - Google Search&quot;&lt;/span&gt;;
            &lt;span style=&quot;color: green;&quot;&gt;//Check that the Title is what we are expecting&lt;/span&gt;
            Assert.AreEqual(title.ToString(), driver.Title);
        }
    }
}&lt;/pre&gt;
&lt;/blockquote&gt;
&lt;/div&gt;
&lt;ul&gt;
&lt;li&gt;Then next build the project and there should not be any build errors. Now how to run the test in nUnit.&lt;/li&gt;
&lt;/ul&gt;
&lt;h2&gt;
3. Execute test in nUnit and generate specflow report.&lt;/h2&gt;
nUnit should be installed in you machine and the Path variable of system should have nUnit bin directory. If this has been done, then in any new command window on typing nUnit and pressing enter should open up nUnit.&amp;nbsp; If this is not the case, you can refer my previous blog on &lt;a href=&quot;http://qtp-automate.blogspot.com/2013/10/how-to-execute-invoke-nunit-from-visual.html&quot; target=&quot;_blank&quot;&gt;nUnit&lt;/a&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Lets try to run tests through commandline first. Open up a command window and navigate to bin directory of the project.&amp;nbsp; And then type nunit-console&amp;nbsp; SpecflowTutorial.dll&amp;nbsp; . This should start a IE browser and do the steps. Below output is seen in command window.&lt;/li&gt;
&lt;/ul&gt;
&lt;span style=&quot;font-family: Century; font-size: xx-small;&quot;&gt;Runtime Environment -&lt;br /&gt;&amp;nbsp;&amp;nbsp; OS Version: Microsoft Windows NT 6.1.7601 Service Pack 1&lt;br /&gt;&amp;nbsp; CLR Version: 2.0.50727.5472 ( Net 3.5 )&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Century; font-size: xx-small;&quot;&gt;ProcessModel: Default&amp;nbsp;&amp;nbsp;&amp;nbsp; DomainUsage: Single&lt;br /&gt;Execution Runtime: net-3.5&lt;br /&gt;.Given I am on the Google home page&lt;br /&gt;-&amp;gt; done: TutorialStepDef.GivenIAmOnTheGoogleHomePage() (6.3s)&lt;br /&gt;When I search for text Webdriver&lt;br /&gt;-&amp;gt; done: TutorialStepDef.WhenISearchForATextSelenium() (4.0s)&lt;br /&gt;Then I should see the search results with title WebDriver - Google Search&lt;br /&gt;-&amp;gt; done: TutorialStepDef.ThenIShouldSeeTheSearchResultsForSelenium() (0.0s)&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;span style=&quot;font-family: Century; font-size: xx-small;&quot;&gt;Tests run: 1, Errors: 0, Failures: 0, Inconclusive: 0, Time: 11.2006407 seconds&lt;br /&gt;&amp;nbsp; Not run: 0, Invalid: 0, Ignored: 0, Skipped: 0&lt;/span&gt;&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Now you have successfully run the Specflow test. But the report from the command window is not sufficient.There is XML file generated by nUnit which can be formatted into specflow report. This where we are going to use second subcommand option of specflow – nunitexecutionreport. For this command one has pass the project file and the xml file as parameters. In command window navigate back to project directory where .csproj file is located. And then enter following command in command window&lt;/li&gt;
&lt;/ul&gt;
specflow.exe nunitexecutionreport SpecflowTutorial.csproj /xmlTestResult:.\bin\Debug\TestResult.xml&lt;br /&gt;
&lt;ul&gt;&lt;br /&gt;
&lt;li&gt;After this command is successfully executed , there is html file created in the project directory which is as shown in below snapshot.&lt;/li&gt;
&lt;/ul&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjDYN0k6cWJxOH-0B2yI-ENRJ-9oDnhKRua7xwhpEdDu5rIYii8UkNsngWGvM5VAUUnXmHkNmgB6LipNcNV8TGoKadNd07HrA3xND6yb4Ryqe9jTQPNX7XDg9CXmGLssA3kOir0cggQvHli/s1600-h/image%25255B4%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;212&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglyufSa9QXVY6-bHVbkfE1X0owhZ6MZqL2k_6lguc7R4m2-e7m-mnQOLvn8u0c8CMx8FC9NDG-_XW1NWtKZNogwTTSBtpC3Nr8pEZKfxA3VYahbjQE5Cnn_c5TeQ65aHtdBLzwvo5TXAeV//?imgmax=800&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;734&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
4. Automate generation of nunit testrunner file having step defintion.&lt;/h2&gt;
Thus so far you have created a sample scenario in Given,When and Then format and execute a test case in specflow plus generated report. But there were many steps that required you to hop in and out of Visual studio and command line. To avoid all these we can automate the generation of binding file from feature file and execution of nunit console/report generation using external tool feature visual studio express. Below step automates generation of *.feature.cs files.&lt;br /&gt;
&lt;ul&gt;&lt;br /&gt;
&lt;li&gt;Create a batch file say Generatesteps.bat and add the below content. And then save it.&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
echo Starting to generate SpecFlow unit tests&lt;br /&gt;
SpecFlow generateAll %1 /force /verbose&lt;br /&gt;
echo Finished generating SpecFlow unit tests&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Open Tools –&amp;gt; External Tools and Click Add. &lt;/li&gt;
&lt;li&gt;Give title as Generate Steps &lt;/li&gt;
&lt;li&gt;In Command window, browse to the GenerateSteps.bat file and select it. &lt;/li&gt;
&lt;li&gt;In Arguments type $(ProjectFileName) &lt;/li&gt;
&lt;li&gt;In&amp;nbsp; Initial Directory type $(ProjectDir) and check option Use Output window.Click Apply and Ok&lt;/li&gt;
&lt;/ul&gt;
Now this external tool is setup and can be accessed from Tools –&amp;gt; Generate Steps. So instead of running a command line&amp;nbsp; like specflow generateall &amp;lt;ProjectPath&amp;gt;\&amp;lt;Projectname.csproj&amp;gt; /force /verbose , you can just click this tool and it automatically picks up all the feature files you created in the project directory and generate *.feature.cs files&lt;br /&gt;
&lt;br /&gt;
&lt;h2&gt;
5. Automate Execution of Specflow tests in nUnit and generation of report&lt;/h2&gt;
&lt;ul&gt;&lt;br /&gt;
&lt;li&gt;Create a batch file and name it as RunSpecflowtests.bat. Add the below content to this batch file and save it&lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;br /&gt;
@echo off&lt;br /&gt;
nunit-console %1&lt;br /&gt;
if NOT %errorlevel% == 0 (&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; echo &quot;Error running tests - %errorlevel%&quot;&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; GOTO :exit&lt;br /&gt;
)&lt;br /&gt;
specflow.exe nunitexecutionreport %2 /xmlTestResult:%3&lt;br /&gt;
if NOT %errorlevel% == 0 (&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; echo Error generating report - %errorlevel%&lt;br /&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp; GOTO :exit&lt;br /&gt;
)&lt;br /&gt;
if %errorlevel% == 0 TestResult.html&lt;br /&gt;
:exit&lt;/blockquote&gt;
&lt;ul&gt;&lt;br /&gt;
&lt;li&gt;Go to Tools –&amp;gt; External tool and click Add &lt;/li&gt;
&lt;li&gt;In Title give it as Run Specflow tests. &lt;/li&gt;
&lt;li&gt;In Command, browse the batch you just created and select it. &lt;/li&gt;
&lt;li&gt;In Arguements box, type “$(TargetName)$(TargetExt) $(ProjectDir)$(ProjectFileName) $(BinDir)TestResult.xml”. &lt;/li&gt;
&lt;li&gt;In Initial Directory type “ $(BinDir)”. And select option Use Output window. Then click apply and Okay. &lt;/li&gt;
&lt;li&gt;Once you have build the project instead of running command lines to execute nUnit-Console and specflow , you can just click Tools-&amp;gt;Run Specflow tests and it should execute the tests and generate the Html file also.&lt;/li&gt;
&lt;/ul&gt;
In this test case, currently in the first method – Given, we are creating a driver. But best approach is create webdriver when feature gets initiated and close the browser when feature closes. I shall explain about this in further blogs.&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/3565922809617850193/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/10/creating-basic-specflow-tests-in-visual.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/3565922809617850193'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/3565922809617850193'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/10/creating-basic-specflow-tests-in-visual.html' title='Basic SpecFlow Automation tests in visual studio express using C# ,Selenium webdriver,nUnit console'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEglyufSa9QXVY6-bHVbkfE1X0owhZ6MZqL2k_6lguc7R4m2-e7m-mnQOLvn8u0c8CMx8FC9NDG-_XW1NWtKZNogwTTSBtpC3Nr8pEZKfxA3VYahbjQE5Cnn_c5TeQ65aHtdBLzwvo5TXAeV/s72-c/?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-1373228658882570352</id><published>2013-10-06T18:12:00.002+01:00</published><updated>2013-10-19T22:12:13.018+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="automation"/><category scheme="http://www.blogger.com/atom/ns#" term="Certification"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="nUnit"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="webDriver"/><title type='text'>How to  invoke nUnit from Visual studio express and execute automation tests</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
nUnit is Unit testing framework tool for testing C# unit test cases. With the invent of selenium webdriver, this C# code intergrated with nUnit framework can be used to run acceptance tests. Simple way to integrate commands into Visual studio express to call nUnit tests is to use external tool feature.&lt;br /&gt;
Before that lets explore what options has nUnit has when you run it from a command line. Type ‘nUnit /help’ in command window which is in the directory where nUnit bin is pointing to, then it pops up below window .&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjLsqqGMMKvL4ggAy7rvNKA78ZXz0_l7gfo3kh0mTKLIIlxQ4mrUBmblYYveuJpCcoiQa6Z68eTK8QhQUPj5Ip2YjTKHI0hIflx17R2VgkHmuetVvejiU0KRTTxHdyjm6cklw2DT8zPH2r6/s1600-h/image%25255B14%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;505&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijaz2-_pulR-nmvTfJvjmEWIWiXQp_XYDOdHQAEN7dDNAB6t8GY0lVdwjArLLXOsTr1YPGW6niL-VNCPCP1K6ej7YqyU2KWzwnzx05VvXd6oXVmzHmBTlu7IW-hdD4ifREXKwm8zdAj3ky//?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;526&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Basically it has two types of argument. First is the name of inputfile which is the DLL file that you want to run. Second is the number of different options. &lt;br /&gt;
So if you type “nUnit &amp;lt;Projectname&amp;gt;.dll /run, this basically would open up nUnit and the project dll and start executing. This is exactly we want, but how to use this command from visual studio to avoid all other headache of entering path etc. That is by using external tool option and with just one click you can get nUnit tests executed from visual studio.&lt;br /&gt;
In visual studio express, go to Tools –&amp;gt; External tools. This Opens up a pop window with option to create a new external tool. Click on Button to Add this new tool and enter the options as shown in the screen shot&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgA7uqQeFh3RIclO_Sr23M4lQuLUC0s3HqKUf52Akla1R9u8LER8wH4guH3uOPkjQSvukRJnmmOez4ZZU59B3ugVegSaTNQQneC2RrfAhIejn7FD2HKrvn21y7oRwpGGM91PYwcjre0QP_J/s1600-h/image%25255B8%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;476&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh0tIbkgrwRwXUUA3r5nuyAJhUNKIkkhP6Zl4bQRKNzwc3neyRJ-5a_9TyGQQ2xQxRyTIqdwKpzXyGLdWj945YUmu9jFbG6ZpZiqtkwKcIHqGTRU0WYK7GEq5GLBEcPy3M1LJtDQZjJTXpm//?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;473&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
1. Enter title as Execute nUnit&lt;br /&gt;
2. In Command, click the button and browse to directory where nUnit.exe is stored and select it.&lt;br /&gt;
3. In Arguments text box , Enter the text as shown in the screenshot. “${BinDir}${TargetName}.dll /run”&lt;br /&gt;
4. In Initial director enter ${BinDir}&lt;br /&gt;
5. Select option prompt for arguments so that you can add additional options like categories if want to include. Then Apply and Ok.&lt;br /&gt;
After you have any nUnit tests created and complied, all you need to do is go to tools –&amp;gt;and click Execute nUnit (Click Okay on the prompt) and this would start nUnit and nUnit would load the dll file of the project you are on visual studio express and then start executing tests.&lt;br /&gt;
To add more flavor to above, say you require to run a particular tagged test instead of all the test cases in the dll. For that you need not go back to defining tool. As we chosen option to prompt for arguments, when you click Execute nUnit, the pop window allows you add the /include the tags you want or exculde the tags that you dont want to run as shown below. I have include the tests with a Tag attribute “NewTest”. The syntax of the argument that needs to be appended is &lt;br /&gt;
/Include:NewTest&lt;br /&gt;
or&lt;br /&gt;
/Exclude:Newtest&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgZN08z73ysN6k_olusGwxHnjETlnHNN_9WZt3G4zF_TOy1nwWr7K5DtxTowPOr5KbFuwI33X2Q9IwV6ESLVVVB8Trlt-usSGl1txnbovUkXRDS-BEB-7H9beuPCCZQZ4WPTYp0mccOYXYy/s1600-h/image%25255B13%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;166&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiAklcJsKNCTCF7IUOCqFytp8W1RdWWFjkmyfW35qGmatxVnJi05KiHgC66Gj4sgfm6q9DOOXWKmFVjQ6w2m7sa_rN7MA8dPCzbAug5nec1H0LCwJPcP0eDPL8y7Z0Zi_bJ-jwTZAA1vxXH//?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;433&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/1373228658882570352/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/10/how-to-execute-invoke-nunit-from-visual.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/1373228658882570352'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/1373228658882570352'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/10/how-to-execute-invoke-nunit-from-visual.html' title='How to  invoke nUnit from Visual studio express and execute automation tests'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEijaz2-_pulR-nmvTfJvjmEWIWiXQp_XYDOdHQAEN7dDNAB6t8GY0lVdwjArLLXOsTr1YPGW6niL-VNCPCP1K6ej7YqyU2KWzwnzx05VvXd6oXVmzHmBTlu7IW-hdD4ifREXKwm8zdAj3ky/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-8165450637017387518</id><published>2013-10-06T16:17:00.002+01:00</published><updated>2013-10-19T22:12:45.710+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="automation"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="nUnit"/><category scheme="http://www.blogger.com/atom/ns#" term="Selenium"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="webDriver"/><title type='text'>Capturing screen shots using remote/local webdriver in C#/Selenium webdriver automation test cases</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
This blog provides details on how can you capture a screenshot using webdriver. You may run webdriver as remote webdriver or local webdriver . Both the webdriver has a method called GetScreenshot() which captures the screenshot of the browser’s current state. In tests it would be useful to capture the screen shot just to make sure the test has executed successfully or capture screenshots when error occurs. So this blog will provide you information on how basically one needs to make calls to these methods and you can use this code or learning from this code to implement it your framework.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;strong&gt;Local Webdriver&lt;/strong&gt;&lt;br /&gt;
Lets first look at local webdriver and how can we capture the screenshot. To run this code, you need to include package named system.Drawing. Thus you the top most part of your code is as below&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot; style=&quot;text-align: left;&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Support;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Remote;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.IE;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Chrome;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; NUnit.Framework;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Drawing;&lt;span style=&quot;font-size: xx-small;&quot;&gt;   &lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
The line of code to capture screenshot is &lt;br /&gt;
&lt;div&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;Screenshot ss = ((ITakesScreenshot)driver).GetScreenshot();&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
From the above instance of screenshot object ss , code has to be written to save the file. For this you can use SaveAsFile method of screenshot object as shown below code. If you don’t provide the path, then file will be saved in default directory which is the directory where the dll is stored&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;ss.SaveAsFile(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Localexplorer.jpeg&quot;&lt;/span&gt;, System.Drawing.Imaging.ImageFormat.Gif);&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
The test method having this implementation looks like this below&lt;/div&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;[Test]
&lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Test_ScreenShotLocalwebdriver()
{
    &lt;span style=&quot;color: green;&quot;&gt;// Step b - Initiating webdriver&lt;/span&gt;
    IWebDriver driver = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; InternetExplorerDriver();
    &lt;span style=&quot;color: green;&quot;&gt;//Step c : Making driver to navigate&lt;/span&gt;

    driver.Navigate().GoToUrl(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://docs.seleniumhq.org/&quot;&lt;/span&gt;);
    &lt;span style=&quot;color: green;&quot;&gt;//Take the screenshot&lt;/span&gt;
    Screenshot ss = ((ITakesScreenshot)driver).GetScreenshot();
    &lt;span style=&quot;color: green;&quot;&gt;//Save the screenshot&lt;/span&gt;
    ss.SaveAsFile(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Localexplorer.jpeg&quot;&lt;/span&gt;, System.Drawing.Imaging.ImageFormat.Gif);

    &lt;span style=&quot;color: green;&quot;&gt;//Step d &lt;/span&gt;
    IWebElement myLink = driver.FindElement(By.LinkText(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Download&quot;&lt;/span&gt;));
    myLink.Click();


    &lt;span style=&quot;color: green;&quot;&gt;//Step e&lt;/span&gt;
    driver.Quit();

}&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;strong&gt;Remote webdriver&lt;/strong&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
For the remote webdriver, the same line of code using GetScreenshot() does not work and the complier complains about wrong typecasting.&amp;nbsp; You may get error such as “&lt;/div&gt;
&lt;br /&gt;
System.InvalidCastException : Unable to cast object of type &#39;OpenQA.Selenium.Remote.RemoteWebDriver&#39; to type &#39;OpenQA.Selenium.ITakesScreenshot”&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
It can be overcome by creating a new class derived from orignial remotewebdriver and interface ITakesScreenShot. In this new drived class the constructor would use the base constructor , but the method getscreenshot can be overidden with new method. This derived class would like this as shown below&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; ScreenShotRemoteWebDriver : RemoteWebDriver, ITakesScreenshot
    {
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; ScreenShotRemoteWebDriver(Uri RemoteAdress, ICapabilities capabilities)
            : &lt;span style=&quot;color: blue;&quot;&gt;base&lt;/span&gt;(RemoteAdress, capabilities)
        {
        }

        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; Screenshot GetScreenshot()
        {
            &lt;span style=&quot;color: green;&quot;&gt;// Get the screenshot as base64. &lt;/span&gt;
            Response screenshotResponse = &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.Execute(DriverCommand.Screenshot, &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;);
            &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; base64 = screenshotResponse.Value.ToString();
            &lt;span style=&quot;color: green;&quot;&gt;// ... and convert it. &lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; Screenshot(base64);
        } 
    }&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
The complete class file below shows example of two tests . One of them uses local driver and other one uses remote webdriver&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Support;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Remote;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.IE;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Chrome;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; NUnit.Framework;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System.Drawing;   


&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; NUnitSelenium
{
    [TestFixture]
    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; UnitTest1
    {

        [SetUp]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; SetupTest()
        {
        }
        [Test]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Test_ScreenShotRemoteBrowser()
        {
            &lt;span style=&quot;color: green;&quot;&gt;// Step b - Initiating webdriver&lt;/span&gt;
            IWebDriver driver = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; ScreenShotRemoteWebDriver(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; Uri(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://127.0.0.1:4444/wd/hub&quot;&lt;/span&gt;), DesiredCapabilities.InternetExplorer());
            &lt;span style=&quot;color: green;&quot;&gt;//Step c : Making driver to navigate&lt;/span&gt;
            
            driver.Navigate().GoToUrl(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://docs.seleniumhq.org/&quot;&lt;/span&gt;);
            &lt;span style=&quot;color: green;&quot;&gt;//Take the screenshot&lt;/span&gt;
            Screenshot ss= ((ITakesScreenshot)driver).GetScreenshot();
            &lt;span style=&quot;color: green;&quot;&gt;//Save the screenshot&lt;/span&gt;
            ss.SaveAsFile(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Remote browser.jpeg&quot;&lt;/span&gt;, System.Drawing.Imaging.ImageFormat.Gif);

            &lt;span style=&quot;color: green;&quot;&gt;//Step d &lt;/span&gt;
            IWebElement myLink = driver.FindElement(By.LinkText(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Download&quot;&lt;/span&gt;));
            myLink.Click();
            
            
            &lt;span style=&quot;color: green;&quot;&gt;//Step e&lt;/span&gt;
            driver.Quit();

        }

        [Test]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Test_ScreenShotLocalwebdriver()
        {
            &lt;span style=&quot;color: green;&quot;&gt;// Step b - Initiating webdriver&lt;/span&gt;
            IWebDriver driver = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; InternetExplorerDriver();
            &lt;span style=&quot;color: green;&quot;&gt;//Step c : Making driver to navigate&lt;/span&gt;

            driver.Navigate().GoToUrl(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://docs.seleniumhq.org/&quot;&lt;/span&gt;);
            &lt;span style=&quot;color: green;&quot;&gt;//Take the screenshot&lt;/span&gt;
            Screenshot ss = ((ITakesScreenshot)driver).GetScreenshot();
            &lt;span style=&quot;color: green;&quot;&gt;//Save the screenshot&lt;/span&gt;
            ss.SaveAsFile(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Localexplorer.jpeg&quot;&lt;/span&gt;, System.Drawing.Imaging.ImageFormat.Gif);

            &lt;span style=&quot;color: green;&quot;&gt;//Step d &lt;/span&gt;
            IWebElement myLink = driver.FindElement(By.LinkText(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Download&quot;&lt;/span&gt;));
            myLink.Click();


            &lt;span style=&quot;color: green;&quot;&gt;//Step e&lt;/span&gt;
            driver.Quit();

        }

    }

    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; ScreenShotRemoteWebDriver : RemoteWebDriver, ITakesScreenshot
    {
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; ScreenShotRemoteWebDriver(Uri RemoteAdress, ICapabilities capabilities)
            : &lt;span style=&quot;color: blue;&quot;&gt;base&lt;/span&gt;(RemoteAdress, capabilities)
        {
        }

        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; Screenshot GetScreenshot()
        {
            &lt;span style=&quot;color: green;&quot;&gt;// Get the screenshot as base64. &lt;/span&gt;
            Response screenshotResponse = &lt;span style=&quot;color: blue;&quot;&gt;this&lt;/span&gt;.Execute(DriverCommand.Screenshot, &lt;span style=&quot;color: blue;&quot;&gt;null&lt;/span&gt;);
            &lt;span style=&quot;color: blue;&quot;&gt;string&lt;/span&gt; base64 = screenshotResponse.Value.ToString();
            &lt;span style=&quot;color: green;&quot;&gt;// ... and convert it. &lt;/span&gt;
            &lt;span style=&quot;color: blue;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; Screenshot(base64);
        } 
    }

}&lt;/pre&gt;
&lt;br /&gt;
Complie the code and then run it in the nUnit . Refer my blog on&amp;nbsp;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/10/how-to-execute-invoke-nunit-from-visual.html&quot; style=&quot;color: #5dc2c0; font-family: Arial, Tahoma, Helvetica, FreeSans, sans-serif; text-decoration: none;&quot; target=&quot;_blank&quot;&gt;&lt;span style=&quot;font-size: small;&quot;&gt;How to invoke nUnit from Visual studio express and execute tests&lt;/span&gt;&lt;/a&gt;&lt;br /&gt;
At the time writing this blog, for some reason, google chrome driver was not capturing full website snapshot while IE was doing full website page snapshot.&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/8165450637017387518/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/10/capturing-screen-shots-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/8165450637017387518'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/8165450637017387518'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/10/capturing-screen-shots-using.html' title='Capturing screen shots using remote/local webdriver in C#/Selenium webdriver automation test cases'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-2841849419707660562</id><published>2013-10-06T00:09:00.002+01:00</published><updated>2013-10-19T22:13:17.702+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="automation"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="nUnit"/><category scheme="http://www.blogger.com/atom/ns#" term="Selenium"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="webDriver"/><title type='text'>How to invoke/run different type of selenium web driver browser using remote webdriver in C# automation scripts</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
Remote web driver feature in selenium is very advantages and helps to achieve distributed testing.&amp;nbsp; Distributed testing comprises testing different browsers on different machine and simultaneous run of tests&amp;nbsp; on number of machines. As a basic lets try to understand how we can we invoke a test case in different browser that is located on different machine using remote webdriver. Declaration for remote webdriver is as below for c# code &lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;IWebDriver driver = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; RemoteWebDriver(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; Uri(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://127.0.0.1:4444/wd/hub&quot;&lt;/span&gt;), DesiredCapabilities.InternetExplorer());&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
The first parameter Uri is the remote address on which selenium is running. In the above example it is running on machine with IP 127.0.0.1(i am running it locally) on port 4444. The second parameter is the capabilities of the browser you going to use. To have successful execution it requires to run selenium on the remote machine and that instance selenium should know where the browser driver are located. This can achieved by using parameter –DWebdriver.ie.driver and assigning it to that of IE driver . Similarly for one can use –DWebdriver.chrome.driver for Chrome driver.&amp;nbsp; Below are the steps and command to be executed to achieve this&lt;/div&gt;
&lt;br /&gt;
&lt;div&gt;
1. Open a new command prompt window&lt;/div&gt;
2. Navigate to the directory where you have selenium standalone server jar is downloaded .(if you dont have one already you can download from &lt;a href=&quot;http://docs.seleniumhq.org/download/&quot; target=&quot;_blank&quot;&gt;link&lt;/a&gt;&lt;br /&gt;
3. Then run the following command in the command window ( the path value shown in blue has to replaced with the path of the drivers where you stored them)&lt;br /&gt;
&lt;br /&gt;
&lt;div&gt;
C:\Data\seleniumCsharp\Drivers&amp;gt;java &lt;strong&gt;-jar&lt;/strong&gt; selenium-server-standalone-2.35.0.jar -&lt;strong&gt;Dwebdriver.chrome.driver&lt;/strong&gt;=&lt;span style=&quot;color: blue;&quot;&gt;C:\Data\seleniumCsharp\Drivers\chromedriver_win32_2.3\c&lt;br /&gt;hromedriver&lt;/span&gt; &lt;strong&gt;-Dwebdriver.ie.driver&lt;/strong&gt;=&lt;span style=&quot;color: blue;&quot;&gt;C:\Data\seleniumCsharp\Drivers\IEDriverServer.&lt;br /&gt;exe&lt;/span&gt;&lt;/div&gt;
&lt;br /&gt;
This should get the selenium server up and running.One can fire requests from different machine using IP address of machine thats get listed when run ipconfig in command window, alternatively you can fire request from same machine using IP 127.0.0.1. .In this case although selenium standalone server is running on same machine, from your scripts if you access it via IP address 127.0.0.1, it mimics the same process as if you were accessing a standalone server on different machine. Once you started the server, you can check if it is running by opening this url &lt;a href=&quot;http://127.0.0.1:4444/wd/hub&quot; title=&quot;http://127.0.0.1:4444/wd/hub&quot;&gt;http://127.0.0.1:4444/wd/hub&lt;/a&gt; (or from different machine using &lt;a href=&quot;http://%3cmachineip%3e/wd/hub&quot; target=&quot;_blank&quot; title=&quot;http://127.0.0.1:4444/wd/hub&quot;&gt;http://&amp;lt;machineIP&amp;gt;/wd/hub&lt;/a&gt;) and it should not throw any error.&lt;br /&gt;
&lt;br /&gt;
So you have so far have setup selenium which can recieve commands through IP 127.0.0.1 and port 4444. Next lets create a class library project in Visual studio express. Say you name it as LanuchRemoteBrowser.&amp;nbsp; The below code shows the declaration of both types of browser and how to invoke it with desired capabilities. &lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System;
&lt;span style=&quot;color: green;&quot;&gt;//Step a&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.IE;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Firefox;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Chrome;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; NUnit.Framework;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Remote;

&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; LanuchRemoteBrowser
{
    [TestFixture]
    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; UnitTest1
    {      &lt;/span&gt;&lt;/span&gt;&lt;span style=&quot;font-family: Arial; font-size: x-small; line-height: 12pt;&quot;&gt;        [SetUp]&lt;/span&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; SetupTest()
        {
        }  
        &lt;span style=&quot;color: green;&quot;&gt;//Test that uses IE Driver&lt;/span&gt;
        [Test]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Test_OpeningHomePageUsingIE()
        {
            &lt;span style=&quot;color: green;&quot;&gt;// Step b - Initiating webdriver&lt;/span&gt;
            IWebDriver driver = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; RemoteWebDriver(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; Uri(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://127.0.0.1:4444/wd/hub&quot;&lt;/span&gt;), DesiredCapabilities.InternetExplorer());
            &lt;span style=&quot;color: green;&quot;&gt;//Step c : Making driver to navigate&lt;/span&gt;
            driver.Navigate().GoToUrl(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://docs.seleniumhq.org/&quot;&lt;/span&gt;);       
            &lt;span style=&quot;color: green;&quot;&gt;//Step d &lt;/span&gt;
            IWebElement myLink = driver.FindElement(By.LinkText(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Download&quot;&lt;/span&gt;));
            myLink.Click();
            &lt;span style=&quot;color: green;&quot;&gt;//Step e&lt;/span&gt;
            driver.Quit();&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;font-family: Arial; font-size: x-small; line-height: 12pt;&quot;&gt;        }&lt;/span&gt;&lt;span style=&quot;font-family: Arial;&quot;&gt;&lt;span style=&quot;font-size: x-small;&quot;&gt;
                 
         &lt;span style=&quot;color: green;&quot;&gt;// Test that uses Google chrome driver&lt;/span&gt;
         [Test]
         &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Test_OpeningHomePageUsingChrome()
        {
            &lt;span style=&quot;color: green;&quot;&gt;// Step b - Initiating webdriver&lt;/span&gt;
            IWebDriver driver = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; RemoteWebDriver(&lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; Uri(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://127.0.0.1:4444/wd/hub&quot;&lt;/span&gt;),DesiredCapabilities.Chrome());
            &lt;span style=&quot;color: green;&quot;&gt;//Step c : Making driver to navigate&lt;/span&gt;
            driver.Navigate().GoToUrl(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://docs.seleniumhq.org/&quot;&lt;/span&gt;);
            &lt;span style=&quot;color: green;&quot;&gt;//Step d &lt;/span&gt;
            IWebElement myLink = driver.FindElement(By.LinkText(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Download&quot;&lt;/span&gt;));
            myLink.Click();
            &lt;span style=&quot;color: green;&quot;&gt;//Step e&lt;/span&gt;
            driver.Quit();
            }
         }
    }&lt;/span&gt;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
Before compiling this code, you need to reference the appropriate dlls from selenium and nunit. For traditional method of doing this, you can refer my previous blog - &lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/05/how-to-setup-cnunit-and-selenium-client.html&quot; target=&quot;_blank&quot;&gt;How to setup C#,nUnit and selenium client drivers on VSExpress for Automated tests&lt;/a&gt;. Alternatively there in another method of adding packages or references to you project using NuGet. Installation of NuGet is straight forward and can installed from Tools &amp;gt; Extentions and Updates. On Extension and Updates window, click on Online –&amp;gt; visual studio gallery and then in search box enter Nuget. Then from list, select NuGet Package manager and install it.&amp;nbsp; &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhtIdeiPLFyE7PQePKHHPh9gSdCUVFrAQ0vI4EO6AOPzR1nfLOz_FRhmrFTzQ0ao3TFo1-UB6P5ifgUwPfA6tmqsA31OKqnbDj1mlE0rBx-1NKRWn4JL0x-Fmrt5f1BGR5VeAAWj5TCh6Y6/s1600-h/image%25255B5%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;191&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoByZo85MgTHCcElwU1TfSwS8w9b1QTJVyRWMVaAbCdsFOnznLNFoBvaIGfGmUPGU7SN2_oCc-CkE9oT5d6oBcFFiwWlTOS2LG-toKTQCTrMoNteBtHBI42VvkwIv46zd4ohU-XBBWt8Qw//?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;713&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Now from Tools –&amp;gt; library package manager, click on Package Manager console.&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkDfJQP3lFyHXnz14v7DKay5omeN-L38ms9P4BDWf9zwS8ewdkO8YnlHtePkpAtg5vjBU9migt87Xt_SPMzVu6A9rT-4bymQDkXi4Izi2QWUU6RVJ-KmcEGjoIkT39JtAHx9WiN0CDsxug/s1600-h/image%25255B10%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;144&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWQiC9pfyVISAkfFoK90G5XS_U-p5VW-WmwDCKEaqcvvLTx4KOKiVNzH0Sbn-lYhwcyRLo6kz3qt0Gevac2pK1rV-GwVARJYm29eFHZzS14UQGR5G2YHGjjQwRhIA7U0WFq7fk2tt7vxAI//?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;727&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
From package manager power shell windows run following commands to add the dependencies/packages using NuGet&lt;br /&gt;
&lt;br /&gt;
&amp;nbsp; &amp;nbsp; 1. Install-Package Selenium.WebDriver&lt;br /&gt;
&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=7247480733244728924&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=7247480733244728924&quot; imageanchor=&quot;1&quot; style=&quot;clear: left; float: left; margin-bottom: 1em; margin-right: 1em;&quot;&gt;&lt;/a&gt;2. Install-Package Selenium.Support&lt;br /&gt;
3. Install-Package Selenium.nUnit&lt;br /&gt;
&lt;br /&gt;
Once you run the above commands you would be having the output in powershell window as shown below&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjxe6T2ljfyZ5yMb2r1Qg1SRsOJvYq4mv2DiAdyPrPNthojnmW-mzmXLDZw1Nu4UxLv7e2AjpAGcdcLYXdTh5mZ9Yu6-vNWTsrTn_Nouv5t_AEUScJ73ClGqowUnUneXmMzvmJvx-1RUxhu/s1600-h/image%25255B17%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;302&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgEgvoVHt6XU8r6rzgbMGWqBKUhDITC6JZkKCmImHhPuH71QqyJLwCB1F9nf87F5iQ8end4KDBN6BnkJFF91KCo8PO0v16TCBvF0c-4UXa-a0osH_7RB_aqwSQpD98EQULx3f2-Y3CCeAXq//?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;748&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Next compile the above code&amp;nbsp; by clicking Build &amp;gt; Build solution and open the dll created in debug directory after compilation via nUnit to run the tests.&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/2841849419707660562/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/10/how-to-invoke-different-type-of-web.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/2841849419707660562'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/2841849419707660562'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/10/how-to-invoke-different-type-of-web.html' title='How to invoke/run different type of selenium web driver browser using remote webdriver in C# automation scripts'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoByZo85MgTHCcElwU1TfSwS8w9b1QTJVyRWMVaAbCdsFOnznLNFoBvaIGfGmUPGU7SN2_oCc-CkE9oT5d6oBcFFiwWlTOS2LG-toKTQCTrMoNteBtHBI42VvkwIv46zd4ohU-XBBWt8Qw/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-2827024477749773295</id><published>2013-10-02T23:25:00.000+01:00</published><updated>2013-10-19T22:14:01.544+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="automation"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="nUnit"/><category scheme="http://www.blogger.com/atom/ns#" term="Selenium"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="webDriver"/><title type='text'>How to invoke locally different types of browser web driver using selenium and c# for test Automation scripts</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;br /&gt;
This blog is in sequence to How to blogs related &lt;a href=&quot;http://qtp-automate.blogspot.co.uk/search/label/C%23&quot; target=&quot;_blank&quot;&gt;Selenium in C#&lt;/a&gt;. In &lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/05/creating-basic-selenium-web-driver-test.html&quot; target=&quot;_blank&quot;&gt;previous blog&lt;/a&gt; of this series , we had created a basic web driver test . Different browsers have different webdrivers and invoking them is all nearly similar but there are slight changes.Of three main browsers – Firefox, Google Chrome and IE – firefox comes inbuilt. Hence in the test written in previous blog we could straight away start using firefox browser without downloading driver file.&lt;br /&gt;
As seen ,the statement below would be all just necessary to create instance of firefox browser.&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;IWebDriver driver = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; FirefoxDriver();&lt;/pre&gt;
&lt;br /&gt;
The same statement for IE or Google chrome would not work as the driver files for these drivers are separate files and do not come embedded with selenium jar. For this one needs to download drivers for IE ( 32 bit or 64 bit ) and Google chrome . These are available from selenium at this &lt;a href=&quot;https://code.google.com/p/selenium/downloads/list&quot; target=&quot;_blank&quot;&gt;location&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
Save them in desktop location something like C:\WebDrivers. After that they can be invoked by passing&amp;nbsp; IE or Google chrome driver&amp;nbsp; path as shown below&lt;br /&gt;
&lt;pre class=&quot;csharpcode&quot;&gt;IWebDriver driver = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; InternetExplorerDriver(&lt;span class=&quot;str&quot;&gt;@&quot;C:\WebDrivers\IEDriverServer.exe&quot;&lt;/span&gt;);
IWebDriver driver = &lt;span class=&quot;kwrd&quot;&gt;new&lt;/span&gt; ChromeDriver (&lt;span class=&quot;str&quot;&gt;@&quot;C:\WebDrivers\chromedriver.exe&quot;&lt;/span&gt;);&lt;/pre&gt;
&lt;br /&gt;
Using above syntax for passing paths of drivers during driver creation, we can write two simple c# selenium tests in visual studio express as below&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; Microsoft.VisualStudio.TestTools.UnitTesting;
&lt;span style=&quot;color: green;&quot;&gt;//Step a&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.IE;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Firefox;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Chrome;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; NUnit.Framework;

&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; NUnitSelenium
{
    [TestFixture]
    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; UnitTest1
    {      

        [SetUp]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; SetupTest()
        {
        }
        
        &lt;span style=&quot;color: green;&quot;&gt;//Test that uses IE Driver&lt;/span&gt;
        [Test]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Test_OpeningHomePageUsingIE()
        {
            &lt;span style=&quot;color: green;&quot;&gt;// Step b - Initiating webdriver&lt;/span&gt;
            IWebDriver driver = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; InternetExplorerDriver(&lt;span style=&quot;color: #006080;&quot;&gt;@&quot;C:\WebDrivers\IEDriverServer.exe&quot;&lt;/span&gt;);

            &lt;span style=&quot;color: green;&quot;&gt;//Step c : Making driver to navigate&lt;/span&gt;
            driver.Navigate().GoToUrl(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://docs.seleniumhq.org/&quot;&lt;/span&gt;);
          
            &lt;span style=&quot;color: green;&quot;&gt;//Step d &lt;/span&gt;
            IWebElement myLink = driver.FindElement(By.LinkText(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Download&quot;&lt;/span&gt;));
            myLink.Click();
     
            &lt;span style=&quot;color: green;&quot;&gt;//Step e&lt;/span&gt;
            driver.Quit();

            )
         }
         
         &lt;span style=&quot;color: green;&quot;&gt;// Test that uses Google chrome driver&lt;/span&gt;
         [Test]
         &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Test_OpeningHomePageUsingChrome()
        {
            &lt;span style=&quot;color: green;&quot;&gt;// Step b - Initiating webdriver&lt;/span&gt;
            IWebDriver driver = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; ChromeDriver (&lt;span style=&quot;color: #006080;&quot;&gt;@&quot;C:\WebDrivers\chromedriver.exe&quot;&lt;/span&gt;);;

            &lt;span style=&quot;color: green;&quot;&gt;//Step c : Making driver to navigate&lt;/span&gt;
            driver.Navigate().GoToUrl(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://docs.seleniumhq.org/&quot;&lt;/span&gt;);
          
            &lt;span style=&quot;color: green;&quot;&gt;//Step d &lt;/span&gt;
            IWebElement myLink = driver.FindElement(By.LinkText(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Download&quot;&lt;/span&gt;));
            myLink.Click();
     
            &lt;span style=&quot;color: green;&quot;&gt;//Step e&lt;/span&gt;
            driver.Quit();

            )
         }
    }&lt;/pre&gt;
Another way in windows is to append Path variable with path of drivers. On how to change the path, you can refer link –&amp;gt; &lt;a href=&quot;http://www.java.com/en/download/help/path.xml&quot; target=&quot;_blank&quot;&gt;How to change Path&lt;/a&gt;&lt;/div&gt;
Once done, you can test this is working by running a new command window. And it command window just type in IEDriverServer.exe. Then you should get the following out put&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi0LGX_vCCyQpY_y3OWarUydkC_h2SwJ6yLx71bIhIoG9Gh-XNiWZ9L-25MwYPSiI26T-mn2iIAYgkkciSCNYAQTLrXAbJJnW1SKvr-04NlgKn1m7l8h5SgkgLhMpcjuQSiUcVeIs8e3MiH/s1600-h/image%25255B5%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;125&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCnSZjD5-4MOJjXX2yXF5S-FqOKn6FixqNeHEahSlXxGSNVPVqL0saSkH-kECHPAGRYeXMwgg5Fxab3kmGIVUJuBL3H2glSAuNq9fgLLnR_FrN8v398bFQENcmqcc5QJiH2oNkWCGSK3oB//?imgmax=800&quot; style=&quot;background-image: none; border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;602&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
You can test the same for google chrome and it should work. Once this setup is done, then on the computer where this PATH has been set, we need to have the code pointing to location of driver exe files, instead then can just have no arguments . Then the tests would like as below&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; Microsoft.VisualStudio.TestTools.UnitTesting;
&lt;span style=&quot;color: green;&quot;&gt;//Step a&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.IE;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Firefox;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Chrome;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; NUnit.Framework;

&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; NUnitSelenium
{
    [TestFixture]
    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; UnitTest1
    {      

        [SetUp]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; SetupTest()
        {
        }
        
        &lt;span style=&quot;color: green;&quot;&gt;//Test that uses IE Driver&lt;/span&gt;
        [Test]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Test_OpeningHomePageUsingIE()
        {
            &lt;span style=&quot;color: green;&quot;&gt;// Step b - Initiating webdriver&lt;/span&gt;
            IWebDriver driver = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; InternetExplorerDriver();

            &lt;span style=&quot;color: green;&quot;&gt;//Step c : Making driver to navigate&lt;/span&gt;
            driver.Navigate().GoToUrl(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://docs.seleniumhq.org/&quot;&lt;/span&gt;);       
    
            &lt;span style=&quot;color: green;&quot;&gt;//Step d &lt;/span&gt;
            IWebElement myLink = driver.FindElement(By.LinkText(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Download&quot;&lt;/span&gt;));
            myLink.Click();
     
            &lt;span style=&quot;color: green;&quot;&gt;//Step e&lt;/span&gt;
            driver.Quit();

            )
         }
         
         &lt;span style=&quot;color: green;&quot;&gt;// Test that uses Google chrome driver&lt;/span&gt;
         [Test]
         &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Test_OpeningHomePageUsingChrome()
        {
            &lt;span style=&quot;color: green;&quot;&gt;// Step b - Initiating webdriver&lt;/span&gt;
            IWebDriver driver = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; ChromeDriver ();;

            &lt;span style=&quot;color: green;&quot;&gt;//Step c : Making driver to navigate&lt;/span&gt;
            driver.Navigate().GoToUrl(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://docs.seleniumhq.org/&quot;&lt;/span&gt;);
          
            &lt;span style=&quot;color: green;&quot;&gt;//Step d &lt;/span&gt;
            IWebElement myLink = driver.FindElement(By.LinkText(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Download&quot;&lt;/span&gt;));
            myLink.Click();
     
            &lt;span style=&quot;color: green;&quot;&gt;//Step e&lt;/span&gt;
            driver.Quit();

            )
         }
    }&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;table border=&quot;5&quot; cellspacing=&quot;0&quot; style=&quot;width: 600px;&quot;&gt;&lt;br /&gt;&lt;tbody&gt;&lt;br /&gt;
&lt;tr&gt;&lt;br /&gt;&lt;td valign=&quot;top&quot; width=&quot;600&quot;&gt;Previous Blogs related selenium webdriver with C#&lt;br /&gt;
1. &lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=7247480733244728924#editor/target=post;postID=6466686349163303727;onPublishedMenu=posts;onClosedMenu=posts;postNum=7;src=postname&quot;&gt;How to setup C#,nUnit and selenium client drivers on VSExpress for Automated tests&lt;/a&gt;&lt;br /&gt;
2. &lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=7247480733244728924#editor/target=post;postID=9065753062201372451;onPublishedMenu=posts;onClosedMenu=posts;postNum=6;src=postname&quot;&gt;Creating Basic Selenium web driver test case using Nunit and C#&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/2827024477749773295/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/10/how-to-invoke-locally-different-types.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/2827024477749773295'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/2827024477749773295'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/10/how-to-invoke-locally-different-types.html' title='How to invoke locally different types of browser web driver using selenium and c# for test Automation scripts'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjCnSZjD5-4MOJjXX2yXF5S-FqOKn6FixqNeHEahSlXxGSNVPVqL0saSkH-kECHPAGRYeXMwgg5Fxab3kmGIVUJuBL3H2glSAuNq9fgLLnR_FrN8v398bFQENcmqcc5QJiH2oNkWCGSK3oB/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-3854087860686629156</id><published>2013-09-03T23:17:00.001+01:00</published><updated>2013-09-10T14:49:23.248+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Defect"/><category scheme="http://www.blogger.com/atom/ns#" term="Quality Center"/><category scheme="http://www.blogger.com/atom/ns#" term="TestCase"/><category scheme="http://www.blogger.com/atom/ns#" term="Testing"/><title type='text'>Quality Center test instances /test cases that are blocked and corresponding linked defects</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;/div&gt;
One time or the other during the test execution phase, one comes across a question on how to find the test cases that are blocked by defect. This is key because &lt;br /&gt;
&lt;br /&gt;
1. It helps to identify the defects that are blocking the test cases and highlight them to defect management teams&lt;br /&gt;
&lt;br /&gt;
2. It helps to identify any defects that are closed recently and would have been inappropriately linked to a test case.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
To determine this result, a SQL query can be executed in Quality center to retrieve the results. Generally any user can execute this query in Quality center by feature called excel query. &amp;nbsp;Before moving onto this excel query , few points needs to be understood &lt;br /&gt;
&lt;br /&gt;
Difference between test case and test instances : A single test case can be extracted into multiple test sets and also within same test set. If one pulls multiple tests of same test case into a test set, this becomes test instances of that particular test case.&lt;br /&gt;
&lt;br /&gt;
Linked defect : This is the defect that is linked to a particular test instance . For instance multiple defects can be linked to many test cases or multiple test instance can be linked to many test cases.&lt;br /&gt;
&lt;br /&gt;
*Note - Defects in Quality center can be linked at many levels to different entities.Such as one can link a defect to requirement and then change the status to blocked, etc. &amp;nbsp;In this blog, I am referring to linked defects that are linked to test instances in the test set. This is generally many people follow during the test execution&lt;br /&gt;
&lt;br /&gt;
In Quality center, the BUG ID for the linkage is stored in table called link. Bugs can be linked to test case, test instances, and requirements etc. These are called entities in quality center. As we are trying to find linked defects to test instances, the entity type for us in question is “TESTCYCL” (the table that holds test instances)&lt;br /&gt;
Below is the ER diagram for LINK table and BUG table.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiz5U_eTQiyJTb6hEj-Pj-yOhsEJDEuEUAw1FUVTS8tEnTffrINz1NlNSWLRgPWceGMLTxb6rg-GZhY-oi5ciRiKSriPfx_5Dny9cyp_7yboqDZzJ6Hy59_iBfMFQ1AmjBGMMjIxgLGhoAQ/s1600-h/image%25255B3%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;443&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje6bnQskDcQl5MYGBxxumhwMOHvHsrBmjct717YB_3XhfboiCX5635Pvymfkp3JxwKwWv_2j9w2ocpSujGIsMGk0AgaOu0d9Rm2fCdTuKGKUyUYhhhwWVAUkiwO0fcqr8dm8g83biraoaq//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;644&quot; /&gt;&lt;/a&gt; .&lt;br /&gt;
TESTCYCL table consisting test instances is linked to TEST table (that holds test cases) by common field TEST_ID. Using these information we can construct the query as below which retrieves test cases, corresponding test instances and linked defect.&lt;br /&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; T.TS_NAME, TC.TC_TEST_INSTANCE,LN_BUG_ID &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt;
&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt;TEST T, TESTCYCL TC , LINK L&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;WHERE&lt;/span&gt;
&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt;T.TS_TEST_ID=TC.TC_TEST_ID &lt;/span&gt;&lt;span style=&quot;color: green; font-size: 8pt; line-height: 12pt;&quot;&gt;-- Condition joining TEST (testcases) and TESTCYCL (Test instances) table&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; L.LN_ENTITY_TYPE=&lt;/span&gt;&lt;span style=&quot;color: #006080; font-size: 8pt; line-height: 12pt;&quot;&gt;&#39;TESTCYCL&#39;&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: green; font-size: 8pt; line-height: 12pt;&quot;&gt;-- This condition makes sure that defects linked to test instaces only need to retrieved&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; TC.TC_TESTCYCL_ID=L.LN_ENTITY_ID &lt;/span&gt;&lt;span style=&quot;color: green; font-size: 8pt; line-height: 12pt;&quot;&gt;-- Condition to join LINK and TESTCYCL table&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; TC.TC_STATUS = &lt;/span&gt;&lt;span style=&quot;color: #006080; font-size: 8pt; line-height: 12pt;&quot;&gt;&#39;BLOCKED&#39;&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;div&gt;
In addition to above, it may be also necessary to know whether those defects are closed are not. Now that means in addition to retrieval of result from above query, you would also like to get the status of the defect . For this it requires to join BUG table. The below listed is the query that will also retrieve status of the defect.&lt;/div&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; T.TS_NAME, TC.TC_TEST_INSTANCE, LN_BUG_ID,B.BG_STATUS &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt;
&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt;TEST T, TESTCYCL TC , LINK L ,BUG B&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;WHERE&lt;/span&gt;
&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt;T.TS_TEST_ID=TC.TC_TEST_ID&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; L.LN_ENTITY_TYPE=&lt;/span&gt;&lt;span style=&quot;color: #006080; font-size: 8pt; line-height: 12pt;&quot;&gt;&#39;TESTCYCL&#39;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; LN_BUG_ID = BG_BUG_ID&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; TC.TC_TESTCYCL_ID=L.LN_ENTITY_ID&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;AND&lt;/span&gt; TC.TC_STATUS = &lt;span style=&quot;color: #006080;&quot;&gt;&#39;BLOCKED&#39;&lt;/span&gt;
&lt;/pre&gt;
&lt;br /&gt;
Apart from the above cases, you might also be interested to retrieve those test instances which are assigned to closed defects so that you can set the status back appropriately and remove the linkage. Below query that helps to achieve that&lt;/div&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;SELECT&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; T.TS_NAME, TC.TC_TEST_INSTANCE, LN_BUG_ID,TC.TC_STATUS &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;FROM&lt;/span&gt;
&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt;TEST T, TESTCYCL TC , LINK L ,BUG B&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;WHERE&lt;/span&gt;
&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt;T.TS_TEST_ID=TC.TC_TEST_ID&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; L.LN_ENTITY_TYPE=&lt;/span&gt;&lt;span style=&quot;color: #006080; font-size: 8pt; line-height: 12pt;&quot;&gt;&#39;TESTCYCL&#39;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; LN_BUG_ID = BG_BUG_ID&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; TC.TC_TESTCYCL_ID=L.LN_ENTITY_ID&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; B.BG_STATUS = &lt;/span&gt;&lt;span style=&quot;color: #006080; font-size: 8pt; line-height: 12pt;&quot;&gt;&#39;Closed&#39;&lt;/span&gt;&lt;/pre&gt;
&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
The other useful blogs related excel queries, Audit tables and QC history can be found in following locations&lt;br /&gt;
&lt;h5&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2010/05/first-time-fix-failures-or-reopen.html&quot; target=&quot;_blank&quot;&gt;First time Fix faliures or Reopen defects&lt;/a&gt;&lt;/b&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2010/04/how-to-retrieve-quality-center-bug.html&quot; target=&quot;_blank&quot;&gt;How to retrieve Quality Center bug details and Audit tables information&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/08/qc-history-for-closed-defect-status.html&quot; target=&quot;_blank&quot;&gt;How to retrieve QC status history for closed defect&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2010/05/how-to-retrieve-test-sets-test.html&quot; target=&quot;_blank&quot;&gt;How to retrieve test instances and test sets within particular folder&lt;/a&gt; &lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2010/05/how-to-retrieve-requirement-test-case.html&quot; target=&quot;_blank&quot;&gt;How to retrieve requirements and test coverage and linked test cases&lt;/a&gt; &lt;/li&gt;
&lt;br /&gt;  &lt;/ol&gt;
&lt;/h5&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/3854087860686629156/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/09/quality-center-test-instances-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/3854087860686629156'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/3854087860686629156'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/09/quality-center-test-instances-test.html' title='Quality Center test instances /test cases that are blocked and corresponding linked defects'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEje6bnQskDcQl5MYGBxxumhwMOHvHsrBmjct717YB_3XhfboiCX5635Pvymfkp3JxwKwWv_2j9w2ocpSujGIsMGk0AgaOu0d9Rm2fCdTuKGKUyUYhhhwWVAUkiwO0fcqr8dm8g83biraoaq/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-8068515964390927147</id><published>2013-08-25T19:56:00.000+01:00</published><updated>2013-08-28T21:41:11.466+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Defect"/><category scheme="http://www.blogger.com/atom/ns#" term="Quality Center"/><category scheme="http://www.blogger.com/atom/ns#" term="Testing"/><title type='text'>Quality center defect history – To track the defects that have undergone severity change</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
This blog is in response to comments from one of my previous blog. I was away from quality centre for long time and had not got the oppurtunity to reply to the comment. Now I feel I should blog about this if it could help someone else and I know how it can be done.&lt;br /&gt;
&lt;br /&gt;
As mentioned in my previous blogs, history of any entity in the QC can be retrieved from AUDIT_PROPERTIES and AUDIT_LOG tables. In the previous blog &lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/08/qc-history-for-closed-defect-status.html&quot; target=&quot;_blank&quot;&gt;QC History for closed defect – Status History&lt;/a&gt;, there is explanation on how to join these tables. I will quickly jump to main of query on how to retrieve defects that have undergone severity change&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
To find this, you need to basically pick defects that have changed from one status to another status. This is recorded in AUDIT_PROPERTIES table as AP_OLD_VALUE and AP_NEW_VALUE. So if defect severity is changes the AP_OLD_VALUE will have old value and AP_NEW_VALUE will have new value. If the severity is just set for first time then , AP_OLD_VALUE is null. Thus we need to find defects that do not have NULL value in&amp;nbsp; AP_OLD_VALUE&lt;br /&gt;
&lt;br /&gt;
AP.AP_OLD_VALUE IS NOT NULL&lt;br /&gt;
&lt;br /&gt;
Since we are interested in the defects that have undergone change for severity, we need to put a where condition that just filters out defects having severity change.&lt;br /&gt;
&lt;br /&gt;
AP.AP_FIELD_NAME = ‘BG_SEVERITY’&lt;br /&gt;
&lt;br /&gt;
Using these two above conditions, you can arrive at the query as shown below that will retrieve all defects which have undergone change in severity levels.&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; B.BG_BUG_ID,AL.AU_TIME ,AL.AU_USER ,AP.AP_OLD_VALUE  &lt;span style=&quot;color: blue;&quot;&gt;as&lt;/span&gt; OLD_STATUS ,AP.AP_NEW_VALUE &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; NEW_STATUS &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; BUG B
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;INNER&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;JOIN&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; AUDIT_LOG AL&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;ON&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; AL.AU_ENTITY_ID = B.BG_BUG_ID&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;INNER&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;JOIN&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; AUDIT_PROPERTIES AP&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;ON&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; AL.AU_ACTION_ID = AP.AP_ACTION_ID&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; AL.AU_ENTITY_TYPE = &lt;/span&gt;&lt;span style=&quot;color: #006080; font-size: 8pt; line-height: 12pt;&quot;&gt;&#39;BUG&#39;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; AL.AU_ACTION_ID= AP.AP_ACTION_ID&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; AP.AP_FIELD_NAME = &lt;/span&gt;&lt;span style=&quot;color: #006080; font-size: 8pt; line-height: 12pt;&quot;&gt;&#39;BG_SEVERITY&#39;&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;AND&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; AP.AP_OLD_VALUE &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;IS&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;NOT&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;NULL&lt;/span&gt;
&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;ORDER&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;BY&lt;/span&gt;&lt;span style=&quot;font-size: 8pt; line-height: 12pt;&quot;&gt; AU_TIME &lt;/span&gt;&lt;span style=&quot;color: blue; font-size: 8pt; line-height: 12pt;&quot;&gt;DESC&lt;/span&gt;
&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
Below is the snapshot showing the output&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgdYKBRKIWun_tpp0TZu4fPZJ5CVkVJj6n-nlLEAG9PPjvqhXMgIeoj7W3jkZm9hZ5a01WLDvsXfOEi4yOS_nizXqThgz3uG1IkzQ1XjEerhqK6sV2uH6So9SuSPSJZ7BioYIhK5Hay3eci/s1600-h/image%25255B3%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;207&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI04mikEJVEAkXYyoFsZ-4L9F-1E-0PyeGxq9nI-e6wI89UsuMVCi36LkFzzrGpzmPOulqs-GeLg6oBJc5qVEQ7l3ojBqPrJmf7Rgj-n-v_-y5TuTvmFHenkgczM9FzhxwLJMIAxL-9vlw//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;644&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Another user of this query is , say if it is required to extract the defects that have undergone severity change in last three months, then all you need to do this add one more condition to where clause as shown in below and and you should retrieve the results as expected. &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;br /&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;SELECT&lt;/span&gt; B.BG_BUG_ID,AL.AU_TIME ,AL.AU_USER ,AP.AP_OLD_VALUE  &lt;span style=&quot;color: blue;&quot;&gt;as&lt;/span&gt; OLD_STATUS ,AP.AP_NEW_VALUE &lt;span style=&quot;color: blue;&quot;&gt;AS&lt;/span&gt; NEW_STATUS &lt;span style=&quot;color: blue;&quot;&gt;FROM&lt;/span&gt; BUG B
&lt;span style=&quot;color: blue;&quot;&gt;INNER&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;JOIN&lt;/span&gt; AUDIT_LOG AL
&lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; AL.AU_ENTITY_ID = B.BG_BUG_ID
&lt;span style=&quot;color: blue;&quot;&gt;INNER&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;JOIN&lt;/span&gt; AUDIT_PROPERTIES AP
&lt;span style=&quot;color: blue;&quot;&gt;ON&lt;/span&gt; AL.AU_ACTION_ID = AP.AP_ACTION_ID
&lt;span style=&quot;color: blue;&quot;&gt;AND&lt;/span&gt; AL.AU_ENTITY_TYPE = &lt;span style=&quot;color: #006080;&quot;&gt;&#39;BUG&#39;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;AND&lt;/span&gt; AL.AU_ACTION_ID= AP.AP_ACTION_ID
&lt;span style=&quot;color: blue;&quot;&gt;AND&lt;/span&gt; AP.AP_FIELD_NAME = &lt;span style=&quot;color: #006080;&quot;&gt;&#39;BG_SEVERITY&#39;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;AND&lt;/span&gt; AP.AP_OLD_VALUE &lt;span style=&quot;color: blue;&quot;&gt;IS&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;NOT&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;NULL&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;AND&lt;/span&gt; AL.AU_TIME &amp;gt; &lt;span style=&quot;color: #006080;&quot;&gt;&#39;20130501&#39;&lt;/span&gt;
&lt;span style=&quot;color: blue;&quot;&gt;ORDER&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;BY&lt;/span&gt; AU_TIME &lt;span style=&quot;color: blue;&quot;&gt;DESC&lt;/span&gt;&lt;/pre&gt;
&lt;br /&gt;
The other useful blogs related to Audit tables and QC history can be found in following locations&lt;br /&gt;
&lt;h2&gt;
&lt;/h2&gt;
&lt;h3&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2010/05/first-time-fix-failures-or-reopen.html&quot; target=&quot;_blank&quot;&gt;First time Fix faliures or Reopen defects&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2010/04/how-to-retrieve-quality-center-bug.html&quot; target=&quot;_blank&quot;&gt;How to retrieve Quality Center bug details and Audit tables information&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/08/qc-history-for-closed-defect-status.html&quot; target=&quot;_blank&quot;&gt;How to retrieve QC status history for closed defect&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2010/05/how-to-retrieve-test-sets-test.html&quot; target=&quot;_blank&quot;&gt;How to retrieve test instances and test sets within particular folder&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2010/05/how-to-retrieve-requirement-test-case.html&quot; target=&quot;_blank&quot;&gt;How to retrieve requirements and test coverage and linked test cases&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/h3&gt;
&lt;br /&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/8068515964390927147/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/08/quality-center-defect-history-to-track.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/8068515964390927147'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/8068515964390927147'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/08/quality-center-defect-history-to-track.html' title='Quality center defect history – To track the defects that have undergone severity change'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjI04mikEJVEAkXYyoFsZ-4L9F-1E-0PyeGxq9nI-e6wI89UsuMVCi36LkFzzrGpzmPOulqs-GeLg6oBJc5qVEQ7l3ojBqPrJmf7Rgj-n-v_-y5TuTvmFHenkgczM9FzhxwLJMIAxL-9vlw/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-8390777200341224456</id><published>2013-08-23T14:25:00.000+01:00</published><updated>2013-08-23T14:52:46.078+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Quality Center"/><category scheme="http://www.blogger.com/atom/ns#" term="Testing"/><title type='text'>QC history for closed defect – Status History</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
For some defects one would like to know the status history of defect. This can be easily found in the QC when you click on particular defect and then click history tab. But if you want to have this information for multiple defects on single sheet or page, then Excel query option in the QC is the best option.    &lt;br /&gt;
&lt;br /&gt;
The AUDIT_LOG table has all the events registered for a entity and AUDIT_PROPERTIES TABLE has the details of these events.&amp;nbsp; Both these tables can be used to retrieve the history of any defect&lt;br /&gt;
&lt;br /&gt;
Let’s try simple query to extract details for a particular bug. The bug id of BUG table is linked to AUDIT_LOG table with field AU_ENTITY_ID and hence create below inner join to begin with    &lt;br /&gt;
SELECT * FROM BUG B    &lt;br /&gt;
INNER JOIN AUDIT_LOG AL     &lt;br /&gt;
ON AL.AU_ENTITY_ID = B.BG_BUG_ID     &lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
The AUDIT_PROPERTIES table is linked to AUDIT_LOG by Action_id values. The new query will be    &lt;br /&gt;
SELECT * FROM BUG B     &lt;br /&gt;
INNER JOIN AUDIT_LOG AL     &lt;br /&gt;
ON AL.AU_ENTITY_ID = B.BG_BUG_ID     &lt;br /&gt;
INNER JOIN AUDIT_PROPERTIES AP     &lt;br /&gt;
ON AL.AU_ACTION_ID = AP.AP_ACTION_ID     &lt;br /&gt;
&lt;br /&gt;
Next comes the where conditions so that we filter out appropriate records. The new query will be    &lt;br /&gt;
SELECT * FROM BUG B     &lt;br /&gt;
INNER JOIN AUDIT_LOG AL     &lt;br /&gt;
ON AL.AU_ENTITY_ID = B.BG_BUG_ID     &lt;br /&gt;
INNER JOIN AUDIT_PROPERTIES AP     &lt;br /&gt;
ON AL.AU_ACTION_ID = AP.AP_ACTION_ID     &lt;br /&gt;
AND AL.AU_ENTITY_TYPE = &#39;BUG&#39;     &lt;br /&gt;
AND AL.AU_ACTION_ID= AP.AP_ACTION_ID     &lt;br /&gt;
AND AP_FIELD_NAME=&#39;BG_STATUS&#39;     &lt;br /&gt;
AND B.BG_BUG_ID=&#39;26&#39;     &lt;br /&gt;
ORDER BY AU_TIME DESC     &lt;br /&gt;
&lt;br /&gt;
The above query would give values for all the columns of three tables.&amp;nbsp; For status history , typically interested columns are who changed the status of defect, from what status to what status, and when. To retrieve these values the query will be now    &lt;br /&gt;
SELECT AL.AU_TIME ,AL.AU_USER ,AP.AP_OLD_VALUE&amp;nbsp; as OLD_STATUS ,AP.AP_NEW_VALUE AS NEW_STATUS FROM BUG B     &lt;br /&gt;
INNER JOIN AUDIT_LOG AL     &lt;br /&gt;
ON AL.AU_ENTITY_ID = B.BG_BUG_ID     &lt;br /&gt;
INNER JOIN AUDIT_PROPERTIES AP     &lt;br /&gt;
ON AL.AU_ACTION_ID = AP.AP_ACTION_ID     &lt;br /&gt;
AND AL.AU_ENTITY_TYPE = &#39;BUG&#39;     &lt;br /&gt;
AND AL.AU_ACTION_ID= AP.AP_ACTION_ID     &lt;br /&gt;
AND AP_FIELD_NAME=&#39;BG_STATUS&#39;     &lt;br /&gt;
AND B.BG_BUG_ID=&#39;26&#39;     &lt;br /&gt;
ORDER BY AU_TIME DESC     &lt;br /&gt;
&lt;br /&gt;
Below is the result value for defect that I have been querying&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEieZylrSETQgo8Crjd20Fi2bIvzpCJNDG7wJiiwa1EerYUqUFPyWw1t1To24puwkzLIV1h-KJwyZDqYOb9HfDBXmUcz95Ng8i5m4G2QSfuqzYDLdAEkx-NxDaKP1j9mUY-XMkBp2bBTQx4Y/s1600-h/image%25255B9%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;256&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXAlzTzTskDNnis5sVgCKwXCJWkcUGs7sjbyiVJncSlppyLKhz6KoVDZBOWR5A4O7adofN0Zchq8XRvjkYXPDpbjSNtW_i6yEWIDX8E9Mor2QbIIMaEVKZMKnVA8kupzzJ6oqcrmogusQo//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;644&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
The above query can be then generalised by using B.BG_BUG_ID IN (list of defects)&lt;br /&gt;
&lt;br /&gt;
SELECT AL.AU_TIME ,AL.AU_USER ,AP.AP_OLD_VALUE&amp;nbsp; as OLD_STATUS ,AP.AP_NEW_VALUE AS NEW_STATUS FROM BUG B&lt;br /&gt;
INNER JOIN AUDIT_LOG AL&lt;br /&gt;
ON AL.AU_ENTITY_ID = B.BG_BUG_ID&lt;br /&gt;
INNER JOIN AUDIT_PROPERTIES AP&lt;br /&gt;
ON AL.AU_ACTION_ID = AP.AP_ACTION_ID&lt;br /&gt;
AND AL.AU_ENTITY_TYPE = &#39;BUG&#39;&lt;br /&gt;
AND AL.AU_ACTION_ID= AP.AP_ACTION_ID&lt;br /&gt;
AND AP_FIELD_NAME=&#39;BG_STATUS&#39;&lt;br /&gt;
AND B.BG_BUG_ID IN (list of defects)&lt;br /&gt;
ORDER BY AU_TIME DESC&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/8390777200341224456/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/08/qc-history-for-closed-defect-status.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/8390777200341224456'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/8390777200341224456'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/08/qc-history-for-closed-defect-status.html' title='QC history for closed defect – Status History'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgXAlzTzTskDNnis5sVgCKwXCJWkcUGs7sjbyiVJncSlppyLKhz6KoVDZBOWR5A4O7adofN0Zchq8XRvjkYXPDpbjSNtW_i6yEWIDX8E9Mor2QbIIMaEVKZMKnVA8kupzzJ6oqcrmogusQo/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-4720247512039409840</id><published>2013-05-22T20:13:00.001+01:00</published><updated>2013-08-28T21:49:49.367+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="jMeter"/><category scheme="http://www.blogger.com/atom/ns#" term="Load testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Testing"/><title type='text'>Https Recording with New Jmeter</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Https traffic recording with Jmeter had been a issue for quite a long time. With recent version of Jmeter releases, it has tried to fill the gap on this shortcoming. It had previously https spoof until Jmeter version 2.6 which didnt quite work well with redirects etc. The latest release of Jmeter (currently 2.9) doesnt use this anymore. Jmeter https recording works normally. But for some URL&#39;s , it does work straight forward. Below are the steps that needs to be applied so that you can make sure Https recording works.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
1. Importing Jmeter proxy certificate. &lt;br /&gt;
I had looked into this on google, but couldn&#39;t find a source to tell how this can be done. But my colleague found out that there is a file in extras directory of Jmeter.. Its called proxycert.cmd(sh for linux) . Import this file firefox by clicking on Options-&amp;gt;Advanced –&amp;gt;View certificates&amp;gt;Authorities –&amp;gt; Import. After this you should see the Jmeter Proxy certificate as shown below&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCSx44pMUbeLRDrDc847g52UbPu_qQqgPRhArvEkxcRB_vXF5kQAwtykvDtD1Td6Dxz5hzUWTplj9BcfvB5A6V7v3YkPDU-rcwNQqNUCG3NcC937T7uVjfAOW6BwdJz-xnVJFwLJNUUaAw/s1600-h/image%25255B5%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;448&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPnTkvd7GSwMdf6VyLZ-2q8ZE_K-DodaNWiq3MH9-Legzq884Sjj8Z-wOY3-s-8f_ylemx75gUO7zO9LYj30TzErMZZ39ibNnmjRMdA74jpbUG0nMLaEE3asfSOVI0BuCvasSVhGPvAfe2//?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; margin-left: 0px; margin-right: 0px;&quot; title=&quot;image&quot; width=&quot;644&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
Then click on the edit button and tick the all boxes as shown below and click Ok&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj5VFatP5fPPDG3wkegcuqdBKEG4lBDncJmbi0EiCP54UauoIUPocsOwUmEVHp3dzQUl8KAy-BAwq5nmLiyiup85PJtvFTdFJxdmUdGfaaqXY9dzG68zwIKA8EL2lltg0obZbcU2ELt3yS4/s1600-h/image%25255B9%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;447&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEghPSZVO-HAVCnoqjh5-6IgQ0aObMhoTaRhUtax9PSGMFOq1mbObF84SujMgpF6DNHEJ3SFc6GTwcmPD9KJ8PK2ksH5nXWfcaD_tEXiqEtcGDVdKlxTaE8iCmaoLqtauFIIJaUPFukEHo7M//?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;644&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
Try recording in Jmeter now. You may be are aware of normal recording process in Jmeter. If you not, refer this link &lt;a href=&quot;http://jmeter.apache.org/usermanual/jmeter_proxy_step_by_step.pdf&quot; target=&quot;_blank&quot;&gt;Proxy Setup&lt;/a&gt; &lt;br /&gt;
Even after this if you still facing issue recording the https traffic, which I too had, then try to install firefox 3.6. When it didnt work for me after trying the above steps, I downloaded the older version of firefox 3.6. After installing it, I had following options unchecked in the firefox browser options. After this changes, https recording for Jmeter through firefox worked charmingly.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjQUj2DTAnuzhEYE557fs5PRNOb7py9pvay5cFht1Xk31tccS3BcBjUJP7jYeVJ4Bn7iPbgxj1gxlpUGnqJqVtrFrivBvGAVF4VU6VAIcpAxOQrutHpQLyMXNXocYpN7mwXwAIKdydA91pW/s1600-h/image%25255B17%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;484&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhkJmBIzXjREMtpLiZKxu1dV4nX_bTUo4X3lAXlO-CNvdHPPUaUcA4SW5FAB03MnNmJtWoyYxzcq3Wl5kP9t6Li-kjNNPYYl9DoGyry55G3QYIDf-cC0WM7xJnAUtHy7WnwV44HBaOPmsAg//?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;504&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/4720247512039409840/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/05/https-recording-with-new-jmeter_22.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/4720247512039409840'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/4720247512039409840'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/05/https-recording-with-new-jmeter_22.html' title='Https Recording with New Jmeter'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgPnTkvd7GSwMdf6VyLZ-2q8ZE_K-DodaNWiq3MH9-Legzq884Sjj8Z-wOY3-s-8f_ylemx75gUO7zO9LYj30TzErMZZ39ibNnmjRMdA74jpbUG0nMLaEE3asfSOVI0BuCvasSVhGPvAfe2/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-9065753062201372451</id><published>2013-05-19T23:06:00.000+01:00</published><updated>2013-10-19T22:14:29.923+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="automation"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="Selenium"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="webDriver"/><title type='text'>Creating Basic Selenium web driver automation test case using Nunit and C#</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
To create selenium automated tests using C#, you would require nUnit and an IDE like VS express 2012 . To setup these, you can refer my previous blog on &lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/05/how-to-setup-cnunit-and-selenium-client.html&quot; target=&quot;_blank&quot;&gt;setup&lt;/a&gt;. In this blog article, I would write on how to create a basic selenium C# script and execute them on VS Express IDE itself.&lt;br /&gt;
At the end my &lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/05/how-to-setup-cnunit-and-selenium-client.html&quot; target=&quot;_blank&quot;&gt;previous blog&lt;/a&gt;,&amp;nbsp; you would have the code on VS express IDE as below&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; Microsoft.VisualStudio.TestTools.UnitTesting;

&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; UnitTestProject1
{
    [TestClass]
    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; UnitTest1
    {
        [TestMethod]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; TestMethod1()
        {
        }
    }
}&lt;/pre&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;Say you got a test case that would&lt;/div&gt;
&lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;width: 400px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;35&quot;&gt;1&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;365&quot;&gt;Opens up firefox browser&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;35&quot;&gt;2&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;365&quot;&gt;Navigates to selenium website&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;35&quot;&gt;3&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;365&quot;&gt;Clicks on link named Download on the page&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;35&quot;&gt;4&lt;/td&gt;&lt;td valign=&quot;top&quot; width=&quot;365&quot;&gt;close the browser&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;
&lt;div&gt;
Below are few steps you need update this class file to run it as automated test. &lt;/div&gt;
a. Add code lines for importing the packages.&lt;br /&gt;
b. Create instance of webdriver&lt;br /&gt;
c. Add lines to webdriver so that it navigates to the url say “www.seleniumhq.org”&lt;br /&gt;
d. Add lines to click on link on the webpage.&lt;br /&gt;
e. Add lines to close the browser.&lt;br /&gt;
&lt;strong&gt;&lt;br /&gt;&lt;/strong&gt;&lt;strong&gt;Step a :&lt;/strong&gt;&lt;br /&gt;
Add below lines&amp;nbsp; just above namespace. These lines are meant to import the classes that are part of reference libraries&lt;br /&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt;&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt;&quot;&gt; OpenQA.Selenium;&lt;/span&gt;&lt;br /&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Support;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.IE;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; NUnit.Framework;&lt;/pre&gt;
&lt;br /&gt;
&lt;div&gt;
&lt;strong&gt;Step b :&lt;/strong&gt;&lt;/div&gt;
Inside the TestMethod1 , enter following code to call firefox webdriver&lt;br /&gt;
&lt;span style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt;&quot;&gt;IWebDriver driver = &lt;/span&gt;&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt;&quot;&gt;new&lt;/span&gt;&lt;span style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt;&quot;&gt; FirefoxDriver();&lt;/span&gt;&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;strong&gt;Step c:&lt;/strong&gt;&lt;/div&gt;
After the above line of code,&amp;nbsp; type the code that uses the driver instances that was created and navigates to selenium website&lt;br /&gt;
&lt;span style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt;&quot;&gt;driver.Navigate().GoToUrl(&lt;/span&gt;&lt;span style=&quot;color: #006080; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt;&quot;&gt;&quot;http://docs.seleniumhq.org/&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt;&quot;&gt;);&lt;/span&gt;&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;strong&gt;Step d:&lt;/strong&gt;&lt;br /&gt;
Steps b and c basically create a webdriver and invoke URL. They represent a manual user actions like opening a browser and typing URL in address bar and then hitting enter. Next step is to simulate user action of clicking on link named download on the webpage. For this one needs to create a instance of webelement that points to that link element. And using this instance, call a method to click it. So the code would look like below&lt;br /&gt;
&lt;span style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt;&quot;&gt;IWebElement myLink = driver.FindElement(By.LinkText(&lt;/span&gt;&lt;span style=&quot;color: #006080; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt;&quot;&gt;&quot;Download&quot;&lt;/span&gt;&lt;span style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt;&quot;&gt;));&lt;/span&gt;&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;myLink.Click();&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;strong&gt;Step e:&lt;/strong&gt;&lt;/div&gt;
The code from above all steps basically would execute the required steps for the test case. The last step of the test case is to exit the browser. This can be done by using following code&lt;br /&gt;
&lt;span style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt;&quot;&gt;driver.Quit();&lt;/span&gt;&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
After all the above steps you code should look like below.&lt;/div&gt;
&lt;span style=&quot;color: blue; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt;&quot;&gt;using&lt;/span&gt;&lt;span style=&quot;background-color: #f4f4f4; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt;&quot;&gt; System;&lt;/span&gt;&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; Microsoft.VisualStudio.TestTools.UnitTesting;
&lt;span style=&quot;color: green;&quot;&gt;//Step a&lt;/span&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Support;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; OpenQA.Selenium.Firefox;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; NUnit.Framework;

&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; NUnitSelenium
{
    [TestFixture]
    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; UnitTest1
    {      

        [SetUp]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; SetupTest()
        {
        }
        [Test]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; Test_OpeningHomePage()
        {
            &lt;span style=&quot;color: green;&quot;&gt;// Step b - Initiating webdriver&lt;/span&gt;
            IWebDriver driver = &lt;span style=&quot;color: blue;&quot;&gt;new&lt;/span&gt; FirefoxDriver();
            &lt;span style=&quot;color: green;&quot;&gt;//Step c : Making driver to navigate&lt;/span&gt;
            driver.Navigate().GoToUrl(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;http://docs.seleniumhq.org/&quot;&lt;/span&gt;);
          
            &lt;span style=&quot;color: green;&quot;&gt;//Step d &lt;/span&gt;
            IWebElement myLink = driver.FindElement(By.LinkText(&lt;span style=&quot;color: #006080;&quot;&gt;&quot;Download&quot;&lt;/span&gt;));
            myLink.Click();
     
            &lt;span style=&quot;color: green;&quot;&gt;//Step e&lt;/span&gt;
            driver.Quit();

            )
           }
    }&lt;/pre&gt;
Now the test case is ready to run within IDE. To execute this test, first you need to build the project. For this click on Project-&amp;gt; build. Once build is successful, right click inside the method and select run test.&lt;br /&gt;
&lt;br /&gt;
Other way to run the tests in nUnit is open to the DLL file generated from the above project after build (which will be stored in debug directory having name like &amp;lt;projectname.dll&amp;gt;) in nUnit as shown in below snapshot&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqdz7Iv5ZPdSB3LRQ26yCdTHJcYJamsqNW2MKsICSaAY0oruuzHfwH2DlthfTygi7XYydl2j6kOX5ZmGdQmgKqW19Gxgfufa7yqq65DeU0YJMJWFJYVyIvVIIv7MP03O8XnhhhdxbXVDyd/s1600-h/image%25255B4%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;347&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoZvGb4oxQgivmZKM5YV0ANvnkC7Zl4cX2nX2c6GhI7tqe2eBDIgJ5siHtiXp_qeRyhRNIyTQyZhVHmKK1SXQ2KBlmY9-jJFWQGPozrpFfvX8HiDcLjWe9fGos66wnds6q6hDTk_mDRl6g//?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;498&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Once opened in nUnit the test will appear as shown below&lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiuw_N89dnt8rSUDV1aQtW0-wqwNnq91uDw6QtPJjMryC6fGETZ2w_jOe7DZQuikJSbfwrIbu8VGGG-qfqPJvrqGYDubTfjQzzSabw6t8JrlAjIxN_FyrCX2X6VVtDexqObmrRhdke6i00V/s1600-h/image%25255B8%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;127&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUUcuYuwGh4t71N-cdvtKQdNGoax8IB-Z0BGPZbRIX02G8VUDiPqNTihD4JztfaNGvSrh4qqQfFk5Ci-bfw5SBZqcDY31skT-HG4u1thDgzdVPQVueQdXzm4qOOLanFIKu8GghnYIvhJD6//?imgmax=800&quot; style=&quot;background-image: none; border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline; padding-left: 0px; padding-right: 0px; padding-top: 0px;&quot; title=&quot;image&quot; width=&quot;505&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
Click on Run to execute the test successfully.&lt;br /&gt;
&lt;br /&gt;
&lt;table border=&quot;10&quot; cellspacing=&quot;0&quot; style=&quot;width: 600px;&quot; unselectable=&quot;on&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;td valign=&quot;top&quot; width=&quot;600&quot;&gt;Other blogs that may be interesting to you and related to selenium webdriver in C# &lt;br /&gt;
&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: inherit; line-height: 18px;&quot;&gt;On how to setup the IDE (VS express), nUnit and selenium refer&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/05/how-to-setup-cnunit-and-selenium-client.html&quot; rel=&quot;nofollow&quot; style=&quot;font-family: inherit; line-height: 18px;&quot;&gt;How to setup C#,nUnit and selenium client drivers on VSExpress for Automated tests&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: inherit; line-height: 18px;&quot;&gt;On Creating simple script that launches a browser does few steps refer&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: inherit; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/05/creating-basic-selenium-web-driver-test.html&quot; rel=&quot;nofollow&quot; style=&quot;background-color: white; font-family: inherit; line-height: 18px;&quot;&gt;Creating Basic Selenium web driver test case using Nunit and C#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: inherit; line-height: 18px;&quot;&gt;On how to Load the same webpage on a number of different browsers suggest referring&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: inherit; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/10/how-to-invoke-locally-different-types.html&quot; rel=&quot;nofollow&quot; style=&quot;background-color: white; font-family: inherit; line-height: 18px;&quot;&gt;How to invoke locally different types of browser driver using selenium and c#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: inherit; line-height: 18px;&quot;&gt;On Loading the same webpage on a number of virtual machines(which I have set up) for this, you need to use Remote webdriver instead of normal webdriver. Also with remote webdriver, you can launch different types of browser. Refer this webpage&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: inherit; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/10/how-to-invoke-different-type-of-web.html&quot; rel=&quot;nofollow&quot; style=&quot;background-color: white; font-family: inherit; line-height: 18px;&quot;&gt;How to invoke/run different type of web driver browser using remote webdriver in C#&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;span style=&quot;background-color: white; font-family: inherit; line-height: 18px;&quot;&gt;To take snapshot on different browser you can refer the link&lt;/span&gt;&lt;span style=&quot;background-color: white; font-family: inherit; line-height: 18px;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/10/capturing-screen-shots-using.html&quot; rel=&quot;nofollow&quot; style=&quot;background-color: white; font-family: inherit; line-height: 18px;&quot;&gt;Capturing screen shots using remote/local webdriver in C#/Selenium webdriver&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/9065753062201372451/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/05/creating-basic-selenium-web-driver-test.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/9065753062201372451'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/9065753062201372451'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/05/creating-basic-selenium-web-driver-test.html' title='Creating Basic Selenium web driver automation test case using Nunit and C#'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjoZvGb4oxQgivmZKM5YV0ANvnkC7Zl4cX2nX2c6GhI7tqe2eBDIgJ5siHtiXp_qeRyhRNIyTQyZhVHmKK1SXQ2KBlmY9-jJFWQGPozrpFfvX8HiDcLjWe9fGos66wnds6q6hDTk_mDRl6g/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-6466686349163303727</id><published>2013-05-19T22:11:00.000+01:00</published><updated>2013-10-10T10:55:09.843+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="automation"/><category scheme="http://www.blogger.com/atom/ns#" term="C#"/><category scheme="http://www.blogger.com/atom/ns#" term="examples"/><category scheme="http://www.blogger.com/atom/ns#" term="nUnit"/><category scheme="http://www.blogger.com/atom/ns#" term="Selenium"/><category scheme="http://www.blogger.com/atom/ns#" term="tutorial"/><category scheme="http://www.blogger.com/atom/ns#" term="webDriver"/><title type='text'>How to setup C#,nUnit and selenium client drivers on  VSExpress for Automated tests</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
Selenium can be used in conjunction with C# and Nunit to build robust automated test cases. This blog is one of the How to series on selenium-C# that help novice automation tester to learn and build automation test cases.&lt;br /&gt;
In this blog, I would be explaining the how to setup tools for Selenium web driver automation.&lt;br /&gt;
To build selenium webdriver automation test cases in C# and Nunit, you would require to setup&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;IDE for C# - &lt;a href=&quot;http://www.microsoft.com/visualstudio/eng/downloads#d-express-windows-desktop&quot; target=&quot;_blank&quot;&gt;Download Visual studio express for Windows Desktop&lt;/a&gt;. This is free for 30 days and You must register to obtain a free product key for ongoing use after 30 day. Installation of this tool is pretty straight forward&lt;/li&gt;
&lt;li&gt;Nunit - &lt;a href=&quot;http://nunit.org/?p=download&quot; target=&quot;_blank&quot;&gt;Download NUnit&lt;/a&gt; and installation is pretty straight forward&lt;/li&gt;
&lt;li&gt;Selenium Dot net client drivers - &lt;a href=&quot;http://docs.seleniumhq.org/download/&quot; target=&quot;_blank&quot;&gt;Download it from selenium download website&lt;/a&gt; . The latest version at this time is found as shown below. The drivers are nothing but dll files which needs to referred when you build the test cases which is described later in this blog&lt;/li&gt;
&lt;/ol&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgyxTPDBlEj2OHaQ3i60hq78t5PIb1kEbnbLwW7ysVcLUPCjoL1X0ztuqk8Ja4zH1QTL05HHAcUDpJP0UVWhBl1xwyLTr7y3x9aE_mOZrzU1KegcYaCc7RbXsse-v5VfcQDJ2RdVe3P3RHP/s1600-h/clip_image001%25255B4%25255D.png&quot;&gt;&lt;img alt=&quot;clip_image001&quot; border=&quot;0&quot; height=&quot;227&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEify9WkEP2xu0-uGMzunZQFlsBMMs0RWJCntGJjcRBEwUH-42Uvb-k8mwj4LOIHp5UGLua4TYO5bqdibjt-Rfhw_RIHX4Dub-HTQrhzpytr7ykuL84dmn7o_V4PIV9p84kcZbzXHAx_rw0C//?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;clip_image001&quot; width=&quot;644&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
Once the VS express is installed, open the tool and it will display the welcome page. To create a selenium test cases in C#, we need to use C# project of VSExpress. For that on file menu click new project and this open new project window. Open Unit test project under Visual C# and click OK This will open a class file as shown below&lt;br /&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;pre id=&quot;codeSnippet&quot; style=&quot;background-color: #f4f4f4; border-bottom-style: none; border-left-style: none; border-right-style: none; border-top-style: none; color: black; direction: ltr; font-family: &#39;Courier New&#39;, courier, monospace; font-size: 8pt; line-height: 12pt; margin: 0em; overflow: visible; padding-bottom: 0px; padding-left: 0px; padding-right: 0px; padding-top: 0px; text-align: left; width: 100%;&quot;&gt;&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; System;
&lt;span style=&quot;color: blue;&quot;&gt;using&lt;/span&gt; Microsoft.VisualStudio.TestTools.UnitTesting;

&lt;span style=&quot;color: blue;&quot;&gt;namespace&lt;/span&gt; UnitTestProject1
{
    [TestClass]
    &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;class&lt;/span&gt; UnitTest1
    {
        [TestMethod]
        &lt;span style=&quot;color: blue;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: blue;&quot;&gt;void&lt;/span&gt; TestMethod1()
        {
        }
    }
}&lt;/pre&gt;
&lt;br /&gt;&lt;/div&gt;
This is basic test project template in C#. For this projects lets add the references and these include the Selenium web driver which you downloaded and the nUnit dll file from Nunit bin folder. To do this on VS express menu bar, click on project-&amp;gt; add reference. And using browse button browse to directory where you downloaded the selenium c# drivers. Within the directory you may have directory called net40( latest version at the time blog was written) and under this directory select all files and click Ok . Below is the DLL files that I have with current version of C# selenium client libraries. &lt;br /&gt;
&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhcRTyG5iUPLFVrFiJMHIGtmzGIHuvlTYOquALuLvlElW3OKvH0KIx4oul2JI-uVB-UCdjY-cnED75LXfNCtcFD3k7mVLO1xh9DJO-0zq_nz2pihoxBAYgOmiaE9mFk6LX9l5ozAgx06Q8T/s1600-h/clip_image002%25255B3%25255D.png&quot;&gt;&lt;img alt=&quot;clip_image002&quot; border=&quot;0&quot; height=&quot;166&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhMYjKUbCZE5MPGQNNUh29X8igMSO6f229Hataz1WJhkCG5Yq-VJt6Dh9HGJNMxOojGNGBvwkEWU2pwnWKAnWfsWGpkxfQakPxveDgZf2kNLLOhyphenhyphenLpI8D8vmV7n15NUUxRf1edfqADA7bmX//?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;clip_image002&quot; width=&quot;244&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
Once this done we are now set to write automation test cases using Selenium web driver and C#. To Verify whether the selenium client reference libraries are added, try typing at the top “using OpenQA” and press . to see if the selenium packages are displayed.&lt;br /&gt;
&lt;div dir=&quot;ltr&quot; trbidi=&quot;on&quot;&gt;
&lt;div id=&quot;codeSnippetWrapper&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
&lt;table border=&quot;5&quot; cellspacing=&quot;0&quot; style=&quot;width: 600px;&quot; unselectable=&quot;on&quot;&gt;
&lt;tbody&gt;
&lt;tr&gt;
&lt;td valign=&quot;top&quot; width=&quot;600&quot;&gt;Blogs related selenium web driver with C# &lt;br /&gt;1.&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=7247480733244728924#editor/target=post;postID=2827024477749773295;onPublishedMenu=posts;onClosedMenu=posts;postNum=0;src=postname&quot;&gt;How 
to invoke locally different types of browser driver using selenium and c#&lt;/a&gt; 
&lt;br /&gt;2.&lt;a href=&quot;http://www.blogger.com/blogger.g?blogID=7247480733244728924#editor/target=post;postID=9065753062201372451;onPublishedMenu=posts;onClosedMenu=posts;postNum=6;src=postname&quot;&gt;Creating 
Basic Selenium web driver test case using Nunit and 
C#&lt;/a&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;br /&gt;&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/6466686349163303727/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/05/how-to-setup-cnunit-and-selenium-client.html#comment-form' title='3 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/6466686349163303727'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/6466686349163303727'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/05/how-to-setup-cnunit-and-selenium-client.html' title='How to setup C#,nUnit and selenium client drivers on  VSExpress for Automated tests'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEify9WkEP2xu0-uGMzunZQFlsBMMs0RWJCntGJjcRBEwUH-42Uvb-k8mwj4LOIHp5UGLua4TYO5bqdibjt-Rfhw_RIHX4Dub-HTQrhzpytr7ykuL84dmn7o_V4PIV9p84kcZbzXHAx_rw0C/s72-c/?imgmax=800" height="72" width="72"/><thr:total>3</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-8178765591391268869</id><published>2013-05-06T13:22:00.001+01:00</published><updated>2013-05-13T11:08:42.211+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Commandline"/><category scheme="http://www.blogger.com/atom/ns#" term="Load testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Rational Performance tester"/><category scheme="http://www.blogger.com/atom/ns#" term="RPT"/><category scheme="http://www.blogger.com/atom/ns#" term="Testing"/><title type='text'>How to schedule Rational Performance tester(RPT) tests or execute them from command line</title><content type='html'>For some cases, one might find himself in a situation where in , he may require to schedule a test to run late night or later point in time. To achieve this with Rational Performance tester, it can be done by scheduling a window task to run a batch file(or crontab to run a shell script) containing the command line that execute the tests&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
To get cracking on this, first thing is to get the command line written up to execute the rational performance tester test or schedule. For this you need to get the following parameter values that later needs to passed to command through command line.&lt;br /&gt;
-workspace : Path to workspace in which the test or test schedule is present. If you are not aware of this, quick way to get the path value of your workspace is to get this from properties window of the project. Right click of the project node and select properties from the menu. Then the value in the location tab of resource node is the value of the workspace path.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhTY8lzzndkbGzsfYNAoeyJID3QbZW06deuAoBrwGkGJgkNLceoNhq71Rwtpx_j7mfapfzN8B1dcfwhR13C5muDD2sRBPnSJ0Oqt8FZ9idUDjbh8j1dppg4y8bgBxm5xJ7u_tzWtvEmNVNm/s1600-h/image%25255B3%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;484&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn-YWRY2EUCbUcRWSRhZ1QI97GI3er0LNSOtiFpHLCaKliLGqSSb9R8dbQE4HCZfAurNhNu4dc4tBjgvCb6qX8aE1b3zYdT2K-CSnkjKL9Shn0_CXj1K5iZYtiwQSYfFcgAfrYOX_717kS//?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;637&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
-project : This is the name of the project&lt;br /&gt;
-schedule: This is the schedule or the test that is required to executed.&amp;nbsp; To get the value for the test that needs to be executed is to right click of the schedule or the test and select properties from the right click menu. On Properties window, copy the value that is displayed for “Path”. &lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgxWNRWQ15LSwsswmnOsUjUb29wMTBjmE0IT-RIyVjd28Mjvo632IuRJnS9kmDlF4WznAeSmhPEJEw6EY4WbGtzE07Zc1BwxWNe36qXGmqRdSDr_w2Ou77YuQKJ8_W5epbaZgaM5RiIW72M/s1600-h/image%25255B7%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;92&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhABNgW8Cx_tNKJjNbFrY0jiFGYHcivDFtqF9a5FlZWCMTl9hby-PGYsEjQHlagh-rc96DePZ4QnwhTalIPLZdE9u5lIQ-wEOywYS0RmMxUhQ1ni0aEKogAPn4BHpTRafUg6uMCW4wzPtfQ//?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;644&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
Once you have this value, you got the all the information you required to execute the command line.&amp;nbsp; The command you need execute depends is available in plugin directory. There are both shell and batch version. This typically something like “This is typically C:\Program Files\IBM\Rational\SDP\6.0\rpt_prod\eclipse\plugins\com.ibm.rational.test.lt.cmdlineexecute_6.1.2.” In this directory, there are files with .bat and .sh extension which can be used for windows and Unix respectively&lt;br /&gt;
To check if the command line works, navigate to above directory and then issue following command&lt;br /&gt;
cmdline –workspace “&lt;i&gt;workspace&lt;/i&gt; “–project “&lt;i&gt;testproj”&lt;/i&gt; –schedule “&lt;i&gt;schedule_or_test”&lt;/i&gt;&lt;br /&gt;
Once the above command works, you can create a shell script or batch file that can referenced&amp;nbsp; in cron tab or scheduler to execute is automatically.</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/8178765591391268869/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/05/how-to-schedule-rational-performance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/8178765591391268869'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/8178765591391268869'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/05/how-to-schedule-rational-performance.html' title='How to schedule Rational Performance tester(RPT) tests or execute them from command line'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhn-YWRY2EUCbUcRWSRhZ1QI97GI3er0LNSOtiFpHLCaKliLGqSSb9R8dbQE4HCZfAurNhNu4dc4tBjgvCb6qX8aE1b3zYdT2K-CSnkjKL9Shn0_CXj1K5iZYtiwQSYfFcgAfrYOX_717kS/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-4269267585600321470</id><published>2013-05-03T23:14:00.001+01:00</published><updated>2013-05-13T11:08:42.201+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Datapool"/><category scheme="http://www.blogger.com/atom/ns#" term="Load testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Rational Performance tester"/><category scheme="http://www.blogger.com/atom/ns#" term="RPT"/><title type='text'>Tips on Rational Performance Tester (RPT) Datapool</title><content type='html'>After all the time, being used to csv/excel files , when I had to face Datapool in RPT , it wasn’t easy at first on how to manipulate data pool. It became trickily more difficult to handle when the data files grew for larger tests. Below are few of the tricks that helped me to overcome the clumsiness I had with datapool.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
1. How to increase the rows of datapool.&lt;br /&gt;
Generally way of increasing the datapool row is doing a right click and then selecting option insert row. But this doesnt help much when you want say increase a file by 1000 rows . That means you need to do the right and selecting option to insert row 1000 times.&amp;nbsp; Easy way to do this, is the select the last row, and then keep pressing enter (you can literally hold it pressed) to append news rows to the datapool.&lt;br /&gt;
2. How to Import Data pool as CSV file into existing data pool file.&lt;br /&gt;
This option is life saver in manipulating the data pool of RPT. One can prepare a datapool file outside the RPT say in a spreadsheet. And then save this as csv file.&amp;nbsp; You can import data into existing datapool file by import export option. Below are the steps to do it.&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Right click on the existing datapool file. Select import option &lt;/li&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjvNsnlQxsMCGWsrFZP6iyhaaDJoELP2XAohWrRxkUEApWw1bgUrTT_o4avztgxSaohgJw9LCwnjP6tuW7GEASx-LMv6U-MVCpx8lUYbsZLY53qUYz9KG1DZVaJc17Hnk1HJz5bD3N34ZRy/s1600-h/image%25255B2%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;231&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibiJidVuA-4SJrMFI39iwhnkbtNY0IMV729cDGmZ-QG1zF53wj6JSgc7wb_dDSaU4BzHzT_ZfAbjd5ZpixaGI4OwZKonHA_HKUnAKgWrNiyN-78NFsDJBbJbpFX70OoZkvU462gXGGTio1//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;178&quot; /&gt;&lt;/a&gt;&lt;/blockquote&gt;
&lt;ul&gt;   &lt;ul&gt;
&lt;li&gt;This opens up import dialog box . In the text box, type in CSV and this filters out an option called CSV File as Datapool &lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
&lt;blockquote&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjn2a67Dm1GdjpezTaTc563N2f5UOZyVxkL_oAdDrmywDR6kqUK94Z5RLhNOFy22EDVGIXJ8kRG9Nl1pDKq7mp65u8e03ZZmLurkuZDowiysDLMZVqnBUG_HQETxj4w7JZr_W3bw6XLyhgk/s1600-h/image%25255B5%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;132&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhFW-Go_-hE1dnieUgP8bWy6O1OyXRXQMi1fmqn7Z2_BzukDK9B6fTzQEcemaqwppUdtWsSFt3V9gFbVztcMv0G4D9LQ5gH3ZpSgx92pkXBN9coMd3bX9T2u4mw6rhpUjBIpEAGQh4JvMPb//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;244&quot; /&gt;&lt;/a&gt; &lt;/blockquote&gt;
&lt;ul&gt;   &lt;ul&gt;
&lt;li&gt;Then click next which will take you to “Import CSV file as datapool “ dialog. Click browse and select the file that you want to import. Tick/untick the options depending on how your csv is already prepared. ( I generally untick the both of them as I do not have column names in first row and no first column with record numbers.) After that click next to move to last step &lt;/li&gt;
&lt;li&gt;In this step , check the option import into existing datapool. &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEh4hxk7t0avLuLlXQW5TO9RIQI0_BRiYaqCHDLeM-wzFOxaJbGuSrc8nR30cPQ4dVO0oZy6FwMD-aq2ebWQHF36niwofuV0OXBPw4Fhn__rC4TgIwwrc31h6BN_bSQJ5yr9M4J4ZiICT4WS/s1600-h/image%25255B8%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;61&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjHMkS6Tg96144saUpZHHBtWneiopsUfq8vVN1w7xl3lhVyQTB0_mcXzDd0cPd9ghaYIy4wxSPayThyphenhyphen7ji62CysXqGkmfxy0Uj1EZZkwo9ZFgfowpisATto4eMF9qLXESprWJorDAX6GsWG//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;244&quot; /&gt;&lt;/a&gt; . Then select the datapool that you want to import the data. Then in records section &lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiQR9Y9peXs5pqd9kJD60l0JLs6zgPiLdJg4CERHrdXUn-mtI_HIwUegqCHeHATU8-kCXk6X1DXp1VoceOyDd0frv6nLoOEknjpctmf5h1DaROM0MhtyxlxLRcvwUu5OkcOuXdMs9Ze_4Fi/s1600-h/image%25255B11%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;35&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiymuGMmtnEUQhjTlGgCRAVCP-G8PotYm5OQBda9Kmjb8buzd3zi_4pMv4z7RIKWLZGKCFz8zJcl9KqmNCFmYqBEsgTnVfopRGzEyFQl3tnoFf043QvRwtgpiXBaI8liXY46gkRBhLPoINW//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;244&quot; /&gt;&lt;/a&gt; , you can either select replace or append data option and click finish. After this your datapool should have new data from the csv file which you just imported. &lt;/li&gt;
&lt;/ul&gt;
&lt;/ul&gt;
3. How to delete multiple rows from a datapool file.&lt;br /&gt;
General procedure is to select a row and right click and then select delete row options. For some reason or the other, you may require to delete multiple rows from the datapool file. In that case, then this option becomes more painful. Easy trick to do this, is to select the first row, and press hold shift , scroll down and then select the row till which you&amp;nbsp; want the data to be deleted.&amp;nbsp; With Shift still pressed , right click the mouse on the selected area to open up right click menu with option to delete rows. Like this you can delete multiple rows in few small steps.</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/4269267585600321470/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/05/tips-on-rational-performance-tester-rpt.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/4269267585600321470'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/4269267585600321470'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/05/tips-on-rational-performance-tester-rpt.html' title='Tips on Rational Performance Tester (RPT) Datapool'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEibiJidVuA-4SJrMFI39iwhnkbtNY0IMV729cDGmZ-QG1zF53wj6JSgc7wb_dDSaU4BzHzT_ZfAbjd5ZpixaGI4OwZKonHA_HKUnAKgWrNiyN-78NFsDJBbJbpFX70OoZkvU462gXGGTio1/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-8161143264548557838</id><published>2013-04-30T09:02:00.000+01:00</published><updated>2013-05-13T11:08:42.209+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="FIREWALL"/><category scheme="http://www.blogger.com/atom/ns#" term="Load testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Rational Performance tester"/><category scheme="http://www.blogger.com/atom/ns#" term="RPT"/><title type='text'>Running Rational Performance tester with agents on other side of firewall</title><content type='html'>Rational Performance tester in terms of software installations as three components&lt;br /&gt;
1. RPT master or workbench&lt;br /&gt;
2. RPT License server&lt;br /&gt;
3. RPT Agents&lt;br /&gt;
RPT master is similar to controller in Loadrunner and plays central role in configuring and executing tests. In a case, where you got RPT agents inside the firewall and master outside or vice versa, the ports with which this communication generally happens becomes key as these ports need to be opened to make the test execution possible.&amp;nbsp; Also if license server is on other side of firewall with respect to workbench , it also requires to open appropriate firewalls.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;strong&gt;RPT workbench and RPT license server&lt;/strong&gt;&lt;br /&gt;
RPT workbench and RPT license server communicate through port number 27000 for the purpose of license check. If license check is not working , first thing to look at whether the port 27000 is open by doing telnet to each other on this port. This can be reconfigured to use different port by changing the port number at both license key administrator on work bench and on license server.&lt;br /&gt;
To change this, open up the license administrator&amp;nbsp; and then click Settings &amp;gt; Client/Server Configuration. This opens up the client server configuration window as shown below when the port number can be changed from default to something else&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi2iWs-jgiur-C_97_SrWmB1ytFpovAQLt5bhXTOwOTCrEoR-cGM1A4q1QoMPGfoXCJ8IRMnjqAHYlTXhkUArRl_fx50jCGOHgWwpcraRjiHBT73qACjJdKj9pYW0mh5pP_Ult__vP-JIvk/s1600-h/image%25255B2%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;164&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0tj-W0VjixiGWsz_lUvD9eAL_1BTYBxN11kzKIvj7AHKNOFGEdvyUcuV8CSdSUALoHbzWZpGEhjCX7JmAQlgdUyqE6FIHuHI4kR21vJcL0mi5kl65CDGafi1iTA_KPnidJ0mYB8PEn-92//?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;244&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;strong&gt;RPT workbench and RPT agent controllers&lt;/strong&gt;&lt;br /&gt;
The forward communication between RPT workbench and RPT agent controllers is on ports 10002,10003 and 10005. The firewall on agents machines should be modified to allow these three ports.&lt;br /&gt;
The backward communication from RPT agent to RPT workbench in on range of dynamic ports. Say if you have three agents, then each of the agent would communicate back on three different ports . In total there are 9 ports 3 each for one agent. Since this number is dynamic, you can define the range beginning with certain port number. On version 8.0 and above , you can define this on following setting&lt;br /&gt;
Windon –&amp;gt; Preferences –&amp;gt; Agent Controller.&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjGu6IzVFeWGkR1thTRJN72lJyKOO1JA-5_fUGOFmq0UXV3WgRLxx__XVT88o2To0mqIA5X2g0gyUcq5cPS-wceNyYxJc5rbRYlVY3zhicDwLOLGu-mLbaPF8Whz-SBKfXwjKrhUHgKjv5v/s1600-h/image%25255B6%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;162&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiUdD1Rjj4UGUxNwKiRRc5uS-_aPAEo4jVhBshC1y671JJPIifwpxqTPAv92asG-j7ZxEJPU7GloKbaOyWYKgDCJxcimqqwElWUOFZn6dGV4EY0ig3R5K4lkwsc5ohHV-uG7W8K1_Szrz4v//?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;362&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
As in above snapshot, the port number to begin with is 25000, and if you had two agents, then first agent would communicate back on 25000, 25001, 25002 and second agent would communicate back on 25003, 25004, 25005. Thus all these ports should be open on the firewall to make the playback of test successful.</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/8161143264548557838/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/04/running-rational-performance-tester.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/8161143264548557838'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/8161143264548557838'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/04/running-rational-performance-tester.html' title='Running Rational Performance tester with agents on other side of firewall'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEj0tj-W0VjixiGWsz_lUvD9eAL_1BTYBxN11kzKIvj7AHKNOFGEdvyUcuV8CSdSUALoHbzWZpGEhjCX7JmAQlgdUyqE6FIHuHI4kR21vJcL0mi5kl65CDGafi1iTA_KPnidJ0mYB8PEn-92/s72-c/?imgmax=800" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-8896080415298705312</id><published>2013-04-29T16:55:00.001+01:00</published><updated>2013-05-13T11:08:42.216+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Load testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Rational Performance tester"/><category scheme="http://www.blogger.com/atom/ns#" term="RPT"/><title type='text'>How to setup Multiple RPT agents on high end server</title><content type='html'>Rational Performance tester agents are driver process built on Java. Rpt agent&amp;nbsp;doesn&#39;t&amp;nbsp;scale up directly even though you throw more hardware&amp;nbsp;in terms&amp;nbsp;of memory/cpu on it. The reason being the memory constraint for Java heap size of the driver process on agent machine. The&amp;nbsp;maximum&amp;nbsp;heap size for RPT_VMARGS property on linux OS is 3000m. So if you have a big iron having multiple cores and high memory as much as 32GB, then running one agent handicaps you from using the real power of the machine and all the memory goes wasted. To overcome this, there is way you run many RPT agent drivers &amp;nbsp;that can help to use the power of the high end server and drive more user load during the test.&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
To run multiple drivers through a Rational agent controller server , there is no need to change the installation as it is built to handle this. But on the agent machine, you need to setup multiple IP alias. Say if the IP address for your agent is 192.140.10.1 then one can setup more IP aliases like 192.140.10.10, 192.140.10.11 etc., as many as agent driver you require.&amp;nbsp; Also on the agent machine, make new deployment directories for each of the new multiple driver you plan to run on the server.&lt;br /&gt;
Then in Workspace on RPT master, configure locations and each location having one of those IP alias like below in mentioned table &lt;br /&gt;
&lt;table border=&quot;1&quot; cellpadding=&quot;2&quot; cellspacing=&quot;0&quot; style=&quot;width: 545px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;133&quot;&gt;Name&lt;/td&gt;        &lt;td valign=&quot;top&quot; width=&quot;133&quot;&gt;Hostname/IP&lt;/td&gt;        &lt;td valign=&quot;top&quot; width=&quot;277&quot;&gt;Deployment Directory&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;133&quot;&gt;Driver1&lt;/td&gt;        &lt;td valign=&quot;top&quot; width=&quot;133&quot;&gt;192.140.10.1&lt;/td&gt;        &lt;td valign=&quot;top&quot; width=&quot;277&quot;&gt;/opt/IBM/SDP/AgentController/tmp&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;133&quot;&gt;Driver2&lt;/td&gt;        &lt;td valign=&quot;top&quot; width=&quot;133&quot;&gt;192.140.10.10&lt;/td&gt;        &lt;td valign=&quot;top&quot; width=&quot;277&quot;&gt;/opt/IBM/SDP/AgentController/tmp1&lt;/td&gt;     &lt;/tr&gt;
&lt;tr&gt;       &lt;td valign=&quot;top&quot; width=&quot;133&quot;&gt;Driver3&lt;/td&gt;        &lt;td valign=&quot;top&quot; width=&quot;133&quot;&gt;192.140.10.11&lt;/td&gt;        &lt;td valign=&quot;top&quot; width=&quot;277&quot;&gt;/opt/IBM/SDP/AgentController/tmp2&lt;/td&gt;     &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
Below are Steps in RPT workspace to set this up.&lt;br /&gt;
1. Creating new Agent location&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgvR4_oc4LQJgfqk_Qvm_Cns0kne_jcMkoTT_vCxf5I3Kco06RyNqYzgqcjSYuoBUUXoPpJp3zwRbG-6ufbIDjuVslRAasPsxxqsLT4SdoUp_WSDZPQNX_IRXTYGdJ7HQDABPuCPOV8HDBF/s1600-h/image%25255B2%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;138&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3pE_xkjPukqRIPDK_GFhKqDMMqGhz1CV4y_CgvwUnt3coXSPhlxiHFH2rQKz-FT-sXqZPb0SlzHxhsXIb8yPExeINHOnmxRqGlg3k6WZ035p7Hd0HyKoxMT1wiQVRnMYz8ScU4ynZPm7x//?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;244&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEitYaN4H_VmISdecT8_lJIzDDV6wlv3v53qvzeN70xBOU8B8T3enNkCnp9qcuXtygXORAHT-TZmyLpB0QSL1ifos3n3IsNCZDUSEJ0B9v5zz-ea5m7zdk7BZ2rllhOzrUIFkx_fI6npWHce/s1600-h/image%25255B5%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;182&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEim6KFFm1AAMgffEJUaABDLi1Ln0AaPu8XDF3dzJwL80hS6QK1-yR_dAPcQr7BbK4R1UIfQwcYS66v5J97PaKgSmTMRiuUnUV1GpEB3FDcjs7VGYxVE2T93nbcWEasBC79z-TDGobtIi4rQ//?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;244&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
Select location from the above window&amp;nbsp; and click OK. Select the path where this agent should be saved in workspace.&lt;br /&gt;
2. Configuring the agent according to above table&lt;br /&gt;
Go to the path where the agent is saved in workspace, and double click to open it. On first tab – General properties , in Name text box, enter the name and in &quot;Hostname or IP address text box&quot;, enter the IP. Click test connection to verify the connection works.&lt;br /&gt;
3. Click general Properties to open up the properties table and create the properties as shown below( linux for linux OS)&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhm5NEIuHkAj3bTVLO2mZ8WaaN4hcSPQ-5Uwq6s-axf7W0_iYlBz5x1M89hyxyxDzI-VXbwR_a5r1XpiPDM-EDwI2Eg94_niuHJK-z67dOpAoLhy7xpJmIpJfy3UUbwZ5Sq_F1a0SUhQZox/s1600-h/image%25255B8%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;75&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjeFZ96GLojH9p3P-tbaP2wYlQJ90OIRXezM_2QVvwjKgbqtvfWOGCp3lMFVNb7K6i0ol7I1PzESxjpcDtSy_bQe1IttYOzNAUChgpxSMy7XQz188LDCvKLZfu7dr-eyF6iD_Oy_e8O7Zqx//?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;244&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
Once these steps are done, the RAC (agent controller) is configured to use multiple agents. You now can choose these agents in user groups in schedule and execute test</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/8896080415298705312/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/04/how-to-setup-multiple-rpt-agents-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/8896080415298705312'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/8896080415298705312'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/04/how-to-setup-multiple-rpt-agents-on.html' title='How to setup Multiple RPT agents on high end server'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi3pE_xkjPukqRIPDK_GFhKqDMMqGhz1CV4y_CgvwUnt3coXSPhlxiHFH2rQKz-FT-sXqZPb0SlzHxhsXIb8yPExeINHOnmxRqGlg3k6WZ035p7Hd0HyKoxMT1wiQVRnMYz8ScU4ynZPm7x/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-8443331219244507961</id><published>2013-04-26T14:50:00.001+01:00</published><updated>2013-05-13T11:08:42.213+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Load testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Rational Performance tester"/><category scheme="http://www.blogger.com/atom/ns#" term="RPT"/><title type='text'>Memory considerations In Rational Performance tester (RPT)</title><content type='html'>Rational Performance tester tool is built on Java/Eclipse technology. Unlike Loadrunner, there are few memory implications that one has to be aware when using Rational performance tester.&lt;br /&gt;
RPT is GUI based tool and main GUI is enhanced eclipse. This is called workbench and mirrors controller in Loadrunner. The memory settings of the eclipse is key in having responsive workbench.&lt;br /&gt;
Other region of interest with regards to RPT memory is the driver memory . This memory is very key is executing higher number of users otherwise, you will face the issue of Java Out of memory very frequently. As evidently this two setting both relate to&amp;nbsp; JVM memory settings.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
1. JVM memory settings for work bench&lt;br /&gt;
The settings for this JVM can be done in the eclipse.ini file found in two directories .&amp;nbsp; One in C:\Program Files\IBM\SDP and another one in C:\Program Files\IBM\SDP\rptse. The file in the former directory corresponds to IBM performance tester - full eclipse&amp;nbsp; and latter one for is plain version. Depending on what version you use you can make change to eclipse.ini file in respective version. To add memory to this JVM, add the startup parameter&amp;nbsp; -Xmx1200m into eclipse.ini file which mean maximum heap size for JVM is 1200 MB. And then restart the rational performance tester. After than you also view how much memory is been used by workbench by enabling the progress bar view for it in Window – &amp;gt; Preference: Show Heap Status&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiIa0LalIVh9A8Ry28cbCaMt9-Jyf6f1FpRYVTHOLpV2sWMOAU6ld2a5S7-zAJuRCX_0KjsDJ4wtidTOs71a-etZkNCnROOKgwKKfEodN_Nv_Cbph0Oe8Y_s91NStUK6A01v29nZo40r84w/s1600-h/image%25255B2%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;46&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5yvGsqZPvuGoeiYL1TH8yEMDvtixXB3su2ipNWUMMueD49Ok6w-lmXGn0DqCCLMbomkYh6top0uZaF8T9CcsDJ6KYc7BBrgfDIrun1x7SwWb5RpDn7OdmaUAD4q9NrQp4VEMXZP-b-n8m//?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;149&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
This JVM setting doesn&#39;t depend on number of users you run, but its useful when you open up many scripts, or open report from the test with large number of errors or with long duration.&lt;br /&gt;
2. JVM memory settings for driver in RPT agent controller&lt;br /&gt;
This is key memory setting and plays major role in the number of users that can be tested without Out of memory issue. This memory setting is for each driver in Agent machines that gets intialised when you kick of the test. The test can carry on if these drivers have more power in terms of memory and CPU. The memory for each of the agent can be specified by passing on parameter RPT_VMARGS&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Open the agent controller location&amp;nbsp; in the workspace by double clicking it.&lt;/li&gt;
&lt;li&gt;Then define new parameter as shown below which means the JVM heapsize for driver on agent machine is 1500MB. The maximum value it can take (as of with RPT 8.2 version ) is 3000MB. If you have big server with huge memory and multiple processors, then you might want to run more agents on these machine because, 3000MB limit of JVM settings will cut down advantage for you from using all the power of agent machine. On How to run multiple agents on one machine, you can refer my other blog&amp;nbsp;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/04/how-to-setup-multiple-rpt-agents-on.html&quot;&gt;How to setup Mutliple agents&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;
&lt;img alt=&quot;New Property window, which shows the Property Name set to RTP_VMARGS, the Operator set to Equals, and the Property Value set to -Xmx1500m&quot; src=&quot;http://publib.boulder.ibm.com/infocenter/rpthelp/v7r0m0/topic/com.ibm.rational.test.lt.doc/images/incmem.gif&quot; /&gt;&lt;br /&gt;
&lt;blockquote&gt;
&lt;/blockquote&gt;
&lt;ul&gt;
&lt;li&gt;Apart from number of users, the other things that have implication on this memory are , large gif file, long script, responses that take long time, SSL connections.&lt;/li&gt;
&lt;/ul&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/8443331219244507961/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/04/memory-considerations-in-rational.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/8443331219244507961'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/8443331219244507961'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/04/memory-considerations-in-rational.html' title='Memory considerations In Rational Performance tester (RPT)'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi5yvGsqZPvuGoeiYL1TH8yEMDvtixXB3su2ipNWUMMueD49Ok6w-lmXGn0DqCCLMbomkYh6top0uZaF8T9CcsDJ6KYc7BBrgfDIrun1x7SwWb5RpDn7OdmaUAD4q9NrQp4VEMXZP-b-n8m/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-6568688026722161063</id><published>2013-04-26T11:59:00.001+01:00</published><updated>2013-05-13T11:08:42.206+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Load testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Rational Performance tester"/><category scheme="http://www.blogger.com/atom/ns#" term="RPT"/><title type='text'>How to create new Rational Performance tester Custom report?</title><content type='html'>Rational Performance tester (RPT) has good feature to create custom reports. The main thing with default reports was the challenge to filter the report for each individual test scripts and have these are readily available in RPT. &lt;br /&gt;
Workaround is to create your own reports that you can fetch whenever required with just couple clicks.&lt;br /&gt;
Below are the steps that can help to create the your own Rational performance tester custom report.&lt;br /&gt;
1. Creating new report template&lt;br /&gt;
2. Creating the tabs as many as you want that have the charts,table or graphic the way you want&lt;br /&gt;
3. Adding graphic filters – like top 10 page hits etc&lt;br /&gt;
4. Adding the performance counters that you want the report to present like average page response time, or total completed transactions etc&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
To go through this process, lets take a standard requirement which most performance engineer would have. Say, one requires a report that shows in each tab, the average response vs time detail chart and the corresponding table for each of the scripts/User journey that are executed in the test&lt;br /&gt;
To create a timeline chart for average response vs time, we would require a chart graphic and counters that in interest are Pages counters – Page response time-&amp;gt; Average response for all Pages. And same counter can be used for tabular data too, but the graphic you require is table.&lt;br /&gt;
Having done this table work for tab, lets get started on&lt;br /&gt;
1. Creating new Report template&lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Click on any old performance report and this report appears in Performance test run window as shown below &lt;/li&gt;
&lt;/ul&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjgX2VFq4i8SxhxGRf8WUt6EIhsA07pZNyD5P6aye1ChNuGJyxJ4jPbf1XxT7d3TUdrca_M6R9W7zGoS4ba70SKoHjSDboV0qz_0wCEJ0FLdgwlQXMH8Cwccb9XOON-Op57zPN3SpNz-5Hp/s1600-h/image%25255B2%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;100&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkOTs5e4WgcGdMpQM6GkbUzlTor3_FXmHUGcXA4TYhAVokAL0SwzdIfHQ8br9_81I_nLcilKYDhNP9kQyJrxnWpDiEaguWZFV6_AoBxRSXFeyvutN9in5SXqHcL7PPzZPvaCHMDmB1xAFq//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;244&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;Click on Manage report button which is as shown below &lt;/li&gt;
&lt;/ul&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgfNLnRAkC0_2EuZYxQ_hS5pGCfWCZwsgSNHm8QIAsXlVuTNeM5RtzE4x6_maxJXKIANF6jxOL0IBAmqF60gVa930FK2ulzJJlukAoWZpCmJbfInQvAiQaW5JvlsxUxFy8CuG7mxUCPhBzW/s1600-h/image%25255B5%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;53&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEho93Vuhu8pj01YaT265HF8r1D5zL8Kldpv5O01FWwIEI11tEHT82bin2TZDk_C_dUhvMoxeIG43MMmsVTkFfxYP9Ps0g2WuNnv77ZOve-DIo3xZR81vow1-1PnwIeTwNtujkJLtDlHHwqf//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;244&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;This Opens up the Select report dialog box .Click create new button &lt;/li&gt;
&lt;/ul&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg2AGdQsuEZs2-VAkBOkn1IjmmolzN_-OPdtmCU_azoJQEN1njgJYYLD0dYmezmW6rVvG_S38d82qHaT5eRtHMSTv_uAnntZSx8PocfofFSNkGsK4Gs1ENOhgcCuSj7nRwGeJk-kvLIuzUh/s1600-h/image%25255B12%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;244&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjg3w6qxkkBgYWQ70LIODqAGq3zB_YCLJbuTiskiqgwrVIxXyt4Ily6rqZfg-d8h5iq9uLhobyPJpJ94ZyZ1wLRx1qA5AlR-Ykup1cruP2D_wcPJHNFKLASl3ft5CkhkzgMgxoy8DS0VeJh//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline; margin-left: 0px; margin-right: 0px;&quot; title=&quot;image&quot; width=&quot;187&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
&lt;ul&gt;
&lt;li&gt;This opens up Create new report dialog. Enter the report name and click insert button &lt;/li&gt;
&lt;/ul&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgQ6t5L7isqzqZwHnqN8GdTbt5siaZ-dwvlyT28TZWNHXSU1S1D2M2cjTesDIIr7Lwahu1CigE1IQ2hBP2cajD-ZM2JZwOqYE7PnnTwEYLxfTKmjD42ZI3jjIkrPljq8apVWj57LC9LnDt8/s1600-h/image%25255B15%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;137&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjTu3gFGwlYprfzs0ZAE270VyUoFilICjfDeLQkVMMd7sdoIIkDM5k-UYjMtR8NZ1vXfX9N45DA-3qxRBlyLzpifUtYfuxryVd-IdNfuGuyWRN3KFJervDZNt_y65lxxiHtKXlXL89WoTGe//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;244&quot; /&gt;&lt;/a&gt;&lt;br /&gt;
2. This opens up create new tab window. Enter the title of the tab for example – feature1 . In the frame, “ select graphic template”, it require to choose the template that can suit the measurements you want the tab to report.&amp;nbsp; For example, if you are looking for a time base chart like average response time over the test period , you can choose “Response vs&amp;nbsp; time detail tab” . After that, click on button Next&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEickWtuPSyotrAGixSHR60ZUeP7wc3vNkmXkc6QlHwROx0wcpoqaE7JizVynvJEvj23DueKX4ynzxNszIJptIdax1fOM8dGSeV5QRlFI2z-AVHJKh5110XmMVPeG1JQdTiP4UPpRZWrR-4o/s1600-h/image%25255B18%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;244&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwpDCc5UDY5BGMas2tqhWW0vLdEl5QeInap0UFyc9QAoJ3VdDRF5QrAfxh8l2nZE1LGSPdUp1ayJfuSAkOBL5z2CO2R_6SpjhHPCkH32bYjeIqNUK8Sq6OV8-K7vjmCPIv9m_Fczg2KTxn//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;222&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
3. Next window that appears showing the option for graphic template that has been selected which is Graphic 1 of 2. Graphic 1 appears on the top and followed by Graphic 2 . Here the selected graphic is line chart . One can add filters here&amp;nbsp; by clicking Add.Since this tab is only for feature1 and say the page names in the your feature1 script has FP1 as prefix, then one can filter the page response time counters that contains “FP1”&amp;nbsp; by selecting the options as shown in below snapshot and filter value. Then Click Ok&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiVaPzEE8s3WO7_PsAz62LROT9KKAvnGH1nDgUZFk1sqiJ8JiBBV71KVJxT-xOEuvlkHLRxnY4Ev-6P12Ru3zVbDnelNDtyQA435OltrLqT8dEhiWk6sWs_iIjRfW9AIYBEwBh8Rcnrp6u1/s1600-h/image%25255B24%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;227&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhHhIr0zCKrrmKo5T4ljkF8g9HwL4snwLhaRsEdCps2xcuBzlPFV3VZAdaUyOT2a-BVuEsFSqq4k8VD3t8AJEChBH_ZeyqF099rp6MgjZcVAp_L_0W8LONE_j3FLKShnbo5ID2Eu9DvBMMg//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;244&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
4. You will come back to Report tab window and then click next. You will see, report tab with frame showing performance counters.&amp;nbsp; One can add any counter that is available by click add and then selecting the values. For this example, I am going to add&amp;nbsp; Page response counter for average values. Lets remove the counter that is selected by default by selecting it and clicking remove. Then click Add and this pops up small menu with different categories of counter. Select Page counters in the option which opens up the Add/Remove Page Performance counters. Select the option as shown below and click Finish&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiqhHyuWPAE5DYqmZus799qAHAIVuGhs2iDimHs9L9JPKmEo5WEpWXXFvhiLYyc2t3Bzu89wUdCnr-GgNOBN9mXlMEKwN-qeKF0WalbXmO57AxAqmf1Vs0lAKPkCcuZpAX4aIwBLVZ-aYQc/s1600-h/image%25255B27%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;194&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEilNOPw2WoVv4PVCX1ndH4hvB_g2Zx8SXznRaWonet5a_OhxcB9MLpXRw3lrR78v4hF22SbRixb919pZjw5oxRfcuAoWjjkOaUBAdau9LdjEBu5Y9IPheJ80rgoRdi4atbC8lf2qkY6UyQP//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;244&quot; /&gt;&lt;/a&gt; &lt;br /&gt;
5. Click Next and you will be presented&amp;nbsp; with dialog saying Graphic2&amp;nbsp; of 2 which has by default selected graphic as Table. You have to remove the same above steps as step 3 and 4&amp;nbsp; and then click finish&lt;br /&gt;
Now at this step, you have created new custom report and new tab within that report for Feature 1. You can do repeat adding of tabs for different feature untill you done with what you require. To open this report for any test you have executed and then select&amp;nbsp; Display report option which will present with window showing the report – Report1 that you just created. Double click to open the report and it all ready now. You can fetch these report whenever you want with just click of two buttons .&lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgCTdjcXbuifj0j-ouC86ewmgF0r1Ogiun60LJNCudEXwLKMFXx3h881QTJGAuFIwKsPz-ec5TFqZKDlw2b7QUVMlVIzwtmSEyuH566owKSi1dXxeUMFhOIQNWEEZQF9oM3W7zznK5fOwDJ/s1600-h/image%25255B30%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;194&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgx9VWeW9Jg0YeuluLuo8bSCNFkbIPtUg7miDSMDSa54o-nvVPzqZTktkY-8k2cUVaBYeiqJZqRjqHRkK89MGV20odRUjulAErucf2lQ7XfGR1y6t9_sT9pXnb08bDqtBErdnRTxsPstQUe//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;244&quot; /&gt;&lt;/a&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/6568688026722161063/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2013/04/how-to-create-new-rational-performance.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/6568688026722161063'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/6568688026722161063'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2013/04/how-to-create-new-rational-performance.html' title='How to create new Rational Performance tester Custom report?'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjkOTs5e4WgcGdMpQM6GkbUzlTor3_FXmHUGcXA4TYhAVokAL0SwzdIfHQ8br9_81I_nLcilKYDhNP9kQyJrxnWpDiEaguWZFV6_AoBxRSXFeyvutN9in5SXqHcL7PPzZPvaCHMDmB1xAFq/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-2127143376176068652</id><published>2012-04-15T13:07:00.000+01:00</published><updated>2013-05-13T11:08:42.198+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Correlation"/><category scheme="http://www.blogger.com/atom/ns#" term="Custom code"/><category scheme="http://www.blogger.com/atom/ns#" term="Load testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Pattern matching"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Rational Performance tester"/><category scheme="http://www.blogger.com/atom/ns#" term="RPT"/><title type='text'>RPT : Extracting value based on the occurrence that is passed dynamically</title><content type='html'>Rational Performance tester does correlation by extracting dynamic values in response by creating a reference. But it lacks ability for an user to specify if the occurrence&amp;nbsp;dynamically&amp;nbsp;that needs to extracted .&lt;br /&gt;
For ex: Say in an application, after user logins , he views displayed list of cards. He picks first card which is default and picks any other card alternatively sometimes. You got a task cut out to create a script which picks 60 percent default card and other 40 percent of time any of the alternate cards. You cannot select &#39;Random Occurrence &#39; option because it defeats purpose of simulating default card 60 % of time or vice&amp;nbsp;verse.&lt;br /&gt;
&lt;br /&gt;
So to overcome the limitation in RPT, one has to find a way to pass the occurrence you want to pick and pick the card by that occurrence value(not just random occurrence). Here in this blog I would focus on extracting that &amp;nbsp;value based on dynamic&amp;nbsp;occurrence&amp;nbsp;which is passed to a custom code interface . For this below are steps that need to be done&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;ol&gt;
&lt;li&gt;Create a reference to extract entire response that contains the html text&amp;nbsp;&lt;/li&gt;
&lt;li&gt;Create a custom code and pass the this reference as an argument along with the&amp;nbsp;occurrence&amp;nbsp;value&lt;/li&gt;
&lt;li&gt;Write java code for this custom code interface that extracts value matching the pattern and occurrence and return the card number extracted &lt;/li&gt;
&lt;/ol&gt;
&lt;b&gt;Step 1 : Create a reference to extract entire response that contains the html text containing all the cards  &lt;/b&gt;&lt;br /&gt;
For this click on the response and from the right side of pane, click on content multiline text box(Do not select any text).   &lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhWtXJnKABupxJCQaqnMBIWnCq0BCG9NFbCoZFFNUsrTCxMFNrgEJ-ekq8cjsuf7XKO6NcjwHa4W4EZtHOC2YNS22uNuUg1PSF0fh8NNibNWpTYGsTrXPchxIY5px0G-HrecqX9b8qf-smn/s1600-h/clip_image001%25255B1%25255D.png&quot;&gt;&lt;img alt=&quot;clip_image001&quot; border=&quot;0&quot; height=&quot;151&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXMVDfqflV3N8d4Q6-meX0luXXucBDVjU2qXbc01uot8tCtFA5alxBRlBKJzHu-J1GIjlLOtc05QavoFsKuNHnYxwjqHocgH_FuK2Skl1ZJHf7lnqVuEJ5WsPs6heLVRDUSdb8Ywt_JNme//?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;clip_image001&quot; width=&quot;553&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;
Right click and RPT displays menu as shown below with an menu item named create reference. Create field reference is different in a way from Create reference , that it extracts complete response into a reference field. While create reference will extract only part of text value that would have been highlighted by cursor. And then click create field reference and give it a appropriate name.  &lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEhOFzh_eoA8bOjZ9jWbHHO4I2s3qojih3WenPFjLHsl6ddTsM47Vcydz_mCwAWK_qb0lQLAkwEhNTeDi980pKOJXiTkvrnD3rPMVTtGJrBocy01knIoiGI6wZBm1HPLwc1sT4-ZkJo1vbYb/s1600-h/clip_image002%25255B3%25255D.png&quot;&gt;&lt;img alt=&quot;clip_image002&quot; border=&quot;0&quot; height=&quot;219&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEic1GlCQFAvt1d1gz7esxFHK_ogWKnDMbkxBwvYEgB39f2pkK6vf6FmDU1a8VX8CUJcl2af63G0qZ-kxW79BU0Y7eV40rhCZv_1O0LfiNAxZf2KMGj_0-8oGKlEo4sr93DscjSaNwVuAWvF//?imgmax=800&quot; style=&quot;border-bottom-width: 0px; border-left-width: 0px; border-right-width: 0px; border-top-width: 0px; display: inline;&quot; title=&quot;clip_image002&quot; width=&quot;244&quot; /&gt;&lt;/a&gt;  &lt;br /&gt;
&lt;b&gt;Step 2: Create a custom code and pass the this reference as an argument   &lt;/b&gt;&lt;br /&gt;
Create a custom code element and Pass this reference as an argument to custom code interface as shown below.I have described in another blog on How to add reference item to custom code. In same, add the another argument that specifies the occurrence that needs to be extracted  &lt;br /&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg5VqMjmy_ULmcB_5E3DTQ4WycPXCEi56mwa3-Q_INwpknKXrrA9t9sefmpk2NdX6NmYOhikBJQ-U1f0QYGh9onYdKL2-qIECw0Mpz5wQl9AdGVAngzKrkgFcou6Lt4VQCDp5CEeo6UphsQ/s1600-h/image5%25255B1%25255D.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;122&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEgbEwDnCm_laWzaNZHntaLkDg3V8InHvlEkjMULckls58V5wnZeJpixidMrj9XEaXo7cGp6LLlrEf7rIc-dRqNeqO0FTeYncZD-WNLfjGqhw8K1e5bghlO2v2jIjFRLHy9xLBPW9sbSZPwl//?imgmax=800&quot; style=&quot;border-bottom: 0px; border-left: 0px; border-right: 0px; border-top: 0px; display: inline;&quot; title=&quot;image&quot; width=&quot;549&quot; /&gt;&lt;/a&gt;   &lt;br /&gt;
&lt;b&gt;Step 3 : Write java code for this custom code interface that extracts value matching the pattern and occurrence and return the card number extracted&lt;/b&gt; .&lt;br /&gt;
There are two ways to return this information to main test script from customcode. One by assigning value to already defined variable using put method call or by passing as return value of the custom code. Below code has both the methods shown  &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
package customcode&lt;span style=&quot;font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
import &lt;span style=&quot;color: #555555;&quot;&gt;java.util.regex.Matcher&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
import &lt;span style=&quot;color: #555555;&quot;&gt;java.util.regex.Pattern&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
import &lt;span style=&quot;color: #555555;&quot;&gt;com.ibm.rational.test.lt.kernel.IDataArea&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
import &lt;span style=&quot;color: #555555;&quot;&gt;com.ibm.rational.test.lt.kernel.services.ITestExecutionServices&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
/**&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
* @author unknown&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
*/&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #445588; font-weight: bold;&quot;&gt;RegExonResponse&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;implements&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
com&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;ibm&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;rational&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;lt&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;kernel&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;custom&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;ICustomCode2&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
/**&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
* Instances of this will be created using the
no-arg constructor.&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
*/&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;RegExonResponse&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin-left: .375in; margin: 0in;&quot;&gt;
/**&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin-left: .375in; margin: 0in;&quot;&gt;
* For javadoc of ICustomCode2 and
ITestExecutionServices interfaces, select &#39;Help Contents&#39; in the&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin-left: .375in; margin: 0in;&quot;&gt;
* Help menu and select &#39;Extending Rational
Performance Tester functionality&#39; -&amp;gt; &#39;Extending test execution with custom
code&#39;&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin-left: .375in; margin: 0in;&quot;&gt;
*/&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;public&lt;/span&gt; String &lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;exec&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;/span&gt;ITestExecutionServices
tes&lt;span style=&quot;font-weight: bold;&quot;&gt;,&lt;/span&gt; String&lt;span style=&quot;font-weight: bold;&quot;&gt;[]&lt;/span&gt; args&lt;span style=&quot;font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: .75in; margin: 0in;&quot;&gt;
String RegExpStr &lt;span style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #dd1144;&quot;&gt;&quot;\&quot;cardId\&quot;:\&quot;(.*?)\&quot;&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: .75in; margin: 0in;&quot;&gt;
&lt;span style=&quot;color: #445588; font-weight: bold;&quot;&gt;int&lt;/span&gt; i &lt;span style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;color: #009999;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: .75in; margin: 0in;&quot;&gt;
&lt;span style=&quot;color: #445588; font-weight: bold;&quot;&gt;int&lt;/span&gt; reqOccurence &lt;span style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; Integer&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;parseInt&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;/span&gt;args&lt;span style=&quot;font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #009999;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;]);&lt;/span&gt; &lt;span style=&quot;color: #999988; font-style: italic;&quot;&gt;// args[1] because this second argument
passed to custom code&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; margin-bottom: 0in; margin-left: 0.75in; margin-right: 0in; margin-top: 0in;&quot;&gt;
String CardBasedOnOccurence &lt;span style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;null;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: .75in; margin: 0in;&quot;&gt;
Pattern pattern &lt;span style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; Pattern&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;compile&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;/span&gt;RegExpStr&lt;span style=&quot;font-weight: bold;&quot;&gt;,&lt;/span&gt;Pattern&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;DOTALL&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: .75in; margin: 0in;&quot;&gt;
IDataArea userDataArea &lt;span style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; tes&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;findDataArea&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;/span&gt;IDataArea&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;VIRTUALUSER&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: .75in; margin: 0in;&quot;&gt;
Matcher matcher &lt;span style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; pattern&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;matcher&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;/span&gt;args&lt;span style=&quot;font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #009999;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;]);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin-left: .75in; margin: 0in;&quot;&gt;
//tes.getTestLogManager().reportMessage(
&quot;Total &quot; + matcher.groupCount());&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: 1.125in; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;while(&lt;/span&gt;matcher&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;find&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;())&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 1.125in; margin-right: 0in; margin-top: 0in;&quot;&gt;
{&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: 1.125in; margin: 0in;&quot;&gt;
i &lt;span style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; i &lt;span style=&quot;font-weight: bold;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #009999;&quot;&gt;1&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: 1.125in; margin: 0in;&quot;&gt;
tes&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;getTestLogManager&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;reportMessage&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd1144;&quot;&gt;&quot;First
occurrence&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;+&lt;/span&gt; matcher&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;group&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;());&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; margin-bottom: 0in; margin-left: 1.5in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;/span&gt;i&lt;span style=&quot;font-weight: bold;&quot;&gt;==&lt;/span&gt;reqOccurence
&lt;span style=&quot;font-weight: bold;&quot;&gt;)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 1.5in; margin-right: 0in; margin-top: 0in;&quot;&gt;
{&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: 1.5in; margin: 0in;&quot;&gt;
CardBasedOnOccurence &lt;span style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; matcher&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;group&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: 1.5in; margin: 0in;&quot;&gt;
&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&lt;span style=&quot;color: #999988; font-style: italic;&quot;&gt;/*Use this step if you have defined a
variable named SelectedCardID in the &lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin-left: 1.5in; margin: 0in;&quot;&gt;
test else, you can skip this and pass value as
return value from this custom&amp;nbsp; &lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin-left: 1.5in; margin: 0in;&quot;&gt;
code as shown in last few lines of code*/&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: 1.5in; margin: 0in;&quot;&gt;
userDataArea&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;put&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;/span&gt;&lt;span style=&quot;color: #dd1144;&quot;&gt;&quot;SelectedCardID&quot;&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;,&lt;/span&gt;CardBasedOnOccurence&lt;span style=&quot;font-weight: bold;&quot;&gt;);&lt;/span&gt; &lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 1.5in; margin-right: 0in; margin-top: 0in;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 1.125in; margin-right: 0in; margin-top: 0in;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 1.5in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; margin-bottom: 0in; margin-left: 1.125in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;if&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;/span&gt;CardBasedOnOccurence&lt;span style=&quot;font-weight: bold;&quot;&gt;==null)&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 1.125in; margin-right: 0in; margin-top: 0in;&quot;&gt;
{&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; margin-bottom: 0in; margin-left: 1.125in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;null;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 1.125in; margin-right: 0in; margin-top: 0in;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 1.125in; margin-right: 0in; margin-top: 0in;&quot;&gt;
else&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 1.125in; margin-right: 0in; margin-top: 0in;&quot;&gt;
{&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; margin-bottom: 0in; margin-left: 1.125in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;return&lt;/span&gt;
CardBasedOnOccurence&lt;span style=&quot;font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 1.125in; margin-right: 0in; margin-top: 0in;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 0.75in; margin-right: 0in; margin-top: 0in;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
}&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/2127143376176068652/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2012/04/rpt-extracting-value-based-on.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/2127143376176068652'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/2127143376176068652'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2012/04/rpt-extracting-value-based-on.html' title='RPT : Extracting value based on the occurrence that is passed dynamically'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiXMVDfqflV3N8d4Q6-meX0luXXucBDVjU2qXbc01uot8tCtFA5alxBRlBKJzHu-J1GIjlLOtc05QavoFsKuNHnYxwjqHocgH_FuK2Skl1ZJHf7lnqVuEJ5WsPs6heLVRDUSdb8Ywt_JNme/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-5377140252595575369</id><published>2012-04-15T00:39:00.000+01:00</published><updated>2013-05-13T11:08:42.203+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Load testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Loadrunner"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Rational Performance tester"/><category scheme="http://www.blogger.com/atom/ns#" term="RPT"/><title type='text'>What does RPT Lacks for a Loadrunner User</title><content type='html'>&lt;br /&gt;
&lt;ol style=&quot;direction: ltr; font-family: Calibri; font-size: 11.0pt; margin-bottom: 0in; margin-left: .3125in; margin-top: 0in; unicode-bidi: embed;&quot;&gt;
 &lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-size: 11pt;&quot;&gt;I have been a HP Loadrunner user
 most of the time for Performance/Load Test.&amp;nbsp;
 Off late, I ventured into task&amp;nbsp;
 to use IBM Rational Performance tester (RPT). I did had very pleasant surprises from this tool . Below
 are few of those to mention&lt;/span&gt;&lt;/div&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-top: 0px; text-align: justify; vertical-align: middle;&quot; value=&quot;1&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;Automatic correlation feature
     got me quite amazed when it worked flawless all the time. RPT Uses Perl
     type of regular expression patterns to extract data from respone.&amp;nbsp; I was impressed with perl regular
     expression back in time when I first used Jmeter and still find they give
     robust way of defining pattern. RPT does all related to automatic extraction
     expression pattern, instance number etc. Thus makes life easy when
     creating a new script. &lt;/span&gt;&lt;/li&gt;
&lt;li style=&quot;margin-bottom: 0px; margin-top: 0px; text-align: justify; vertical-align: middle;&quot; value=&quot;2&quot;&gt;&lt;span style=&quot;font-size: 11pt;&quot;&gt;Not just records thinktime,
     also records client processing delays . Hence represents right way of
     simulating secondary requests&lt;/span&gt;&lt;/li&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
But I find that
 many features ,which are very common to Loadrunner or any scripting tool, are
 missing here in RPT. RPT does make maintaining scripts bit harder without simple
 scripting interface . Below are the few of those missing features that made
 RPT annoying to me at times.&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; font-weight: bold; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
You
 cannot call a test within a test. &lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
This meant that I
 cannot refractor the common steps (like login, etc). This meant that I cannot
 maintain common http calls across the scripts. Frequent RPT users&amp;nbsp; advice another way on how to go about this.&amp;nbsp; They suggest to break up one test in many
 tests and then arrange them in performance test schedule.&amp;nbsp; I did manage to refractor this way, but this
 meant lot of overhead work of creating variables, assigning them .&amp;nbsp; And every time I make change in one test,
 then I need to go to schedule and execute it to verify. Wouldn&#39;t the world be
 easy if we could be able to call a test within a test. This would solve many
 small pestering problems like I just mentioned&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; font-weight: bold; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
Cannot
 verify another test script, if there is already a performance schedule is
 running.&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
While using
 Loadrunner, there were situation,&amp;nbsp; where
 I executed a test in controller for a Project and at the same time, verified
 the scripts from another project. This helped me to make use of those idle
 time when test execution happens in background. But in RPT, you cannot do
 that. You can execute one test at a time. If you executing a main test in RPT
 master, then you cannot verify another script&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; font-weight: bold; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
No
 Vuser end method &lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
In Loadrunner, if
 one stops a test , then users exit gracefully and execute vuser end code. This
 is kind of feature is missing in RPT. Hence it means, when you have an
 application which requires user to logoff , there is no way you can achieve
 this, when you stop the test in middle. Users won&#39;t exit gracefully. &lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
I have an
 application which requires user to logoff else it won&#39;t allow to login back
 for another 10 mins. If I find for some reason that I need to stop the test,
 then I had to wait for 10 minutes, verify all those users are okay (imagine
 time and effort spent to verify 10000 users if I require to) and then restart
 the test. This missing feature has made me to loose lot of time in the middle
 of tests and is very annoying for all who&amp;nbsp;
 are involved in the tests&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; font-weight: bold; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
Cannot
 stop particular user during execution&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
This thing I used
 to frequently in Loadrunner, where in I find some user had corrupt data
 (because they did not logoff properly ) or I require to bring down a
 particular number of users&amp;nbsp; in a
 particular group , then I had means to pick and choose user(s)and then stop
 them. While in RPT, you can still stop users, but you cannot pick and choose
 particular user(s)&amp;nbsp; and then stop them.
 On this front, RPT just fares same as Jmeter which is sad. I admire Jmeter
 although it lacks this feature.&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;Capturing response, data substitution on error or
 failure&lt;/span&gt; &lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in; text-align: justify;&quot;&gt;
This capability was
 one of very good troubleshooting asset of Loadrunner. During a performance
 test with many users doing lot of interaction,&amp;nbsp;
 if an error or failure occurs, you would definitely like to know what
 was request made, response received, data susbituted etc ,and also at same
 moment itself you view them. RPT has bit complex logging method, which I still
 need to get my head around. But what I found ,when eyeball over it, there is
 no obvious way to get this. Only way is you have to log a datapool
 value(parameter in loadrunner), for which you have write a custom code and write
 the value in Test Log. This gets logged irrespective of failure or not.
 Imagine in Http request where you are sending quite number of correlated values plus
 datapool values, then you have write Java custom code to log all of these. Wish, it has some option which allows to capture response, data substitutions etc only on error.&lt;/div&gt;
&lt;/ol&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/5377140252595575369/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2012/04/what-does-rpt-lacks-for-loadrunner-user.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/5377140252595575369'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/5377140252595575369'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2012/04/what-does-rpt-lacks-for-loadrunner-user.html' title='What does RPT Lacks for a Loadrunner User'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-946839172365402771</id><published>2012-04-15T00:38:00.000+01:00</published><updated>2013-05-13T11:08:42.218+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Custom code"/><category scheme="http://www.blogger.com/atom/ns#" term="Java"/><category scheme="http://www.blogger.com/atom/ns#" term="Load testing"/><category scheme="http://www.blogger.com/atom/ns#" term="Performance testing"/><category scheme="http://www.blogger.com/atom/ns#" term="RPT"/><category scheme="http://www.blogger.com/atom/ns#" term="Test log"/><title type='text'>Rational Performance tester(RPT) custom code to log user value fom datapool</title><content type='html'>&lt;br /&gt;
&lt;div style=&quot;font-family: Calibri; font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
Below is
the custom code in Rational Performance tester that I managed for logging username value from datapool
into test log. In Loadrunner, very often one uses commands like
lr_message,lr_log_message to log username that was used by a particular virtual
user in particular iteration. This helps performance tester to check whether
the data was used was appropriate one, of if error occured, then what was the
data used by the users etc. This this can be achieved in RPT by writing custom
java code.&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
Custom&amp;nbsp; Code class implements interface ICustomCode
which has method called exec with method parameters of object type
ITestExecutionServices and type String array&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
The
trick is understand the classes/method/interfaces of this Interface
ITestExecutionServices. This object has information about a virtual user in
interface name IDataArea . Below is the syntax to retrieve this Virtual user
dataarea.&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
IDataArea dataArea &lt;span style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; tes&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;findDataArea&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;/span&gt;IDataArea&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;VIRTUALUSER&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: calibri; font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
From
this Interface, one has to get another interface instance named
IVirtualUserInfo. This interface contains that virtual user information.Below
is the syntax code for that&lt;/div&gt;
&lt;div style=&quot;font-family: calibri; font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
IVirtualUserInfo virtualUserInfo = (IVirtualUserInfo)
dataArea.&lt;span style=&quot;color: teal;&quot;&gt;get&lt;/span&gt;(IVirtualUserInfo.&lt;span style=&quot;color: teal;&quot;&gt;KEY&lt;/span&gt;);&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;margin: 0in;&quot;&gt;
&lt;span style=&quot;font-family: calibri; font-size: 11pt;&quot;&gt;And then from this Interface, one can get virtual userID by method
named called&lt;/span&gt;&lt;span style=&quot;font-family: &#39;bitstream vera sans mono&#39;; font-size: 9pt;&quot;&gt; &lt;/span&gt;&lt;span style=&quot;color: teal; font-family: &#39;bitstream vera sans mono&#39;; font-size: 9pt;&quot;&gt;getUserName&lt;/span&gt;&lt;span style=&quot;font-family: &#39;bitstream vera sans mono&#39;; font-size: 9pt;&quot;&gt;()&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
To log he datapool value of user actually used , I passed
that datapool value as argument to custom code interface. Since it was only one
argument passed, I was able to extract the value of it in custom code by code
syntax &#39;String UserName = args[&lt;span style=&quot;color: #009999;&quot;&gt;0&lt;/span&gt;];&#39; . Below is the complete code&amp;nbsp; for this custom code
interface&lt;/div&gt;
&lt;div style=&quot;font-size: 11pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
package customcode&lt;span style=&quot;font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
import &lt;span style=&quot;color: #555555;&quot;&gt;com.ibm.rational.test.lt.kernel.IDataArea&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
import &lt;span style=&quot;color: #555555;&quot;&gt;com.ibm.rational.test.lt.kernel.services.ITestExecutionServices&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
import &lt;span style=&quot;color: #555555;&quot;&gt;com.ibm.rational.test.lt.kernel.services.IVirtualUserInfo&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
/**&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
* @author unknown&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
*/&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;class&lt;/span&gt; &lt;span style=&quot;color: #445588; font-weight: bold;&quot;&gt;LogUserName&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;implements&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
com&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;ibm&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;rational&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;test&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;lt&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;kernel&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;custom&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;ICustomCode2&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
/**&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
* Instances of this will be created using the
no-arg constructor.&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
*/&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;public&lt;/span&gt; &lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;LogUserName&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;()&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
/**&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
* For javadoc of ICustomCode2 and
ITestExecutionServices interfaces, select &#39;Help Contents&#39; in the&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
* Help menu and select &#39;Extending Rational
Performance Tester functionality&#39; -&amp;gt; &#39;Extending test execution with
custom code&#39;&lt;/div&gt;
&lt;div style=&quot;color: #999988; font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; font-style: italic; margin: 0in;&quot;&gt;
*/&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin: 0in;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;public&lt;/span&gt;
String &lt;span style=&quot;color: #990000; font-weight: bold;&quot;&gt;exec&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;/span&gt;ITestExecutionServices
tes&lt;span style=&quot;font-weight: bold;&quot;&gt;,&lt;/span&gt; String&lt;span style=&quot;font-weight: bold;&quot;&gt;[]&lt;/span&gt; args&lt;span style=&quot;font-weight: bold;&quot;&gt;)&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;{&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
String UserName &lt;span style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; args&lt;span style=&quot;font-weight: bold;&quot;&gt;[&lt;/span&gt;&lt;span style=&quot;color: #009999;&quot;&gt;0&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;];&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
IDataArea dataArea &lt;span style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; tes&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;findDataArea&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;/span&gt;IDataArea&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;VIRTUALUSER&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
IVirtualUserInfo virtualUserInfo &lt;span style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;/span&gt;IVirtualUserInfo&lt;span style=&quot;font-weight: bold;&quot;&gt;)&lt;/span&gt;
dataArea&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;get&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;/span&gt;IVirtualUserInfo&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;KEY&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
String User &lt;span style=&quot;font-weight: bold;&quot;&gt;=&lt;/span&gt;
virtualUserInfo&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;getUserName&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;();&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &amp;quot;Bitstream Vera Sans Mono&amp;quot;; font-size: 9.0pt; margin-left: .375in; margin: 0in;&quot;&gt;
tes&lt;span style=&quot;font-weight: bold;&quot;&gt;.&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;getTestLogManager&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;().&lt;/span&gt;&lt;span style=&quot;color: teal;&quot;&gt;reportMessage&lt;/span&gt;&lt;span style=&quot;font-weight: bold;&quot;&gt;(&lt;/span&gt;User &lt;span style=&quot;font-weight: bold;&quot;&gt;+&lt;/span&gt; &lt;span style=&quot;color: #dd1144;&quot;&gt;&quot;=&quot;&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;+&lt;/span&gt;
UserName&lt;span style=&quot;font-weight: bold;&quot;&gt;);&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; margin-bottom: 0in; margin-left: 0.375in; margin-right: 0in; margin-top: 0in;&quot;&gt;
&lt;span style=&quot;font-weight: bold;&quot;&gt;return&lt;/span&gt; &lt;span style=&quot;font-weight: bold;&quot;&gt;null;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 0.375in; margin-right: 0in; margin-top: 0in;&quot;&gt;
}&lt;/div&gt;
&lt;div style=&quot;font-family: &#39;Bitstream Vera Sans Mono&#39;; font-size: 9pt; font-weight: bold; margin-bottom: 0in; margin-left: 0in; margin-right: 0in; margin-top: 0in;&quot;&gt;
}&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/946839172365402771/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2012/04/rpt-custom-code-to-log-user-value-fom.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/946839172365402771'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/946839172365402771'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2012/04/rpt-custom-code-to-log-user-value-fom.html' title='Rational Performance tester(RPT) custom code to log user value fom datapool'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-7818673813815740672</id><published>2011-10-31T21:00:00.000+00:00</published><updated>2013-09-07T00:11:21.888+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="ANT"/><category scheme="http://www.blogger.com/atom/ns#" term="automation"/><category scheme="http://www.blogger.com/atom/ns#" term="Selenium"/><category scheme="http://www.blogger.com/atom/ns#" term="TestNG"/><title type='text'>Executing Selenium TestNG tests using ANT</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div align=&quot;left&quot;&gt;
ANT is software build automating tool for Java code. Uses XML file named ‘build.xml’ as the input for the build tasks. If one wants to run TestNG task using ANT, XML should contain information for testng calls and this can be built in two ways&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
1. By defining a external task of type TestNG and referring this task in another target ANT call further down in the code&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
2. By defining as Java command in ANT XML&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
The command line syntax to run TestNG task is&amp;nbsp;&amp;nbsp; &lt;span style=&quot;color: #8080ff;&quot;&gt;java org.testng.TestNG testng1.xml [testng2.xml testng3.xml ...].&lt;/span&gt; The second option takes this approach of calling testNG using command line syntax but using ANT&lt;b&gt;.&lt;/b&gt; Lets have look at the first option here in this post&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;hr /&gt;
&lt;/div&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;/div&gt;
&lt;h5 align=&quot;left&quot;&gt;


Defining TestNG task&lt;/h5&gt;
The ANT xml tag to define external Task is by &amp;lt;taskdef&amp;gt; and this takes two attributes @name and @classname. And the tag &amp;lt;Classpath&amp;gt; includes the TestNG jar from the defined path .Hence below is the way to define a ANT task of type TestNG&lt;br /&gt;
&amp;nbsp;1:&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;taskdef name=&quot;testng&quot; classname=&quot;org.testng.TestNGAntTask&quot; &amp;gt;&amp;nbsp; &lt;br /&gt;
2:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;classpath&amp;gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
3:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;pathelement location=&quot;lib/testng-6.2.jar&quot;/&amp;gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
4:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/classpath&amp;gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
5:&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/taskdef&amp;gt;&lt;br /&gt;
&amp;nbsp;&lt;img align=&quot;left&quot; alt=&quot;image&quot; border=&quot;0&quot; height=&quot;169&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIXgi65_fwbf2FqWs4JCbfTAbZuaVZV3TuW5o8lHivamETJ95UvJuMkSVYTayLxk20S2US0UXaS4f69B9hNK8AkEend4iSGRwG2UAbnn7cl5AQ14mUlICI7j7J6dm-AFbQdjHuinnfx0eu//?imgmax=800&quot; style=&quot;border-width: 0px; display: inline; margin-left: 0px; margin-right: 0px;&quot; title=&quot;image&quot; width=&quot;215&quot; /&gt;&lt;br /&gt;
&lt;div align=&quot;left&quot; class=&quot;csharpcode&quot;&gt;
The path in line 3 for me is lib/testng-6.2,jar. This is because have this TestNG jar file in lib folder and my build xml is same folder as my lib folder is as shown is figure beside. so the value for location attribute of pathelement should be relative path of TestNG jar file to your build file&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;style type=&quot;text/css&quot;&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, &quot;Courier New&quot;, courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;left&quot;&gt;
Once the above taskdef is done, next define the actual target for ANT call. Any ANT task are referred by tags &amp;lt;target&amp;gt;. Within this &amp;lt;target&amp;gt; container, we will create a output directory for the testng reports, and then call the testng task that we just have defined&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
1:&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;target name=&quot;runTest&quot;&amp;gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
2:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mkdir dir=&quot;testng_output&quot;/&amp;gt;&amp;lt;!-- Command to create the output directory. --&amp;gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
3:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;testng outputdir=&quot;testng_output&quot; classpathref=&quot;class.path&quot;&amp;gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
4:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xmlfileset dir=&quot;.&quot; includes=&quot;TestNG1.xml&quot;/&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
5:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xmlfileset dir=&quot;.&quot; includes=&quot;TestNG2.xml&quot;/&amp;gt;&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
6:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/testng&amp;gt;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
7:&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/target&amp;gt; &lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;left&quot;&gt;
In above XML, the attribute classpathref actually refers to container of type path having name as ‘class.path’ . So for you , you need to define this path as per below xml before the target tag&amp;nbsp; “runTest”.&amp;nbsp; Below is the xml for defining path containing all classes and jar files from my project folder. And below is the folder structure I have for my project&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiyURGxKM58mzrXBz3AK2CqiG2_5JXvnBJfB7ktDNZ14JgOS0y7jQLe8iMs5HzEM7Eq4rNyfnMN1_hwdmkwlD5XPGCV6umyqHoK_tY9bHNM9G3WmTbURu66rdctGz3Zl-cpvQRVbVBjPMo4/s1600-h/image42.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;222&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEi9PdJzftgr4tBdOs8dMR3c6ED5cqgBIKzzmMNuXNtOv8R7dArfbRR_CXV5osESCKhm-FBeeM8mLPWhTNOPeIc9x8alJejwXYsZr9UCQMkGuMcOTxO26t6eEwfI1nTVEJVvdW7Nob_sRJ6z//?imgmax=800&quot; style=&quot;border-width: 0px; display: inline; margin-left: 0px; margin-right: 0px;&quot; title=&quot;image&quot; width=&quot;260&quot; /&gt;&lt;/a&gt;&amp;nbsp;&lt;/div&gt;
&lt;br /&gt;
&lt;br /&gt;
1: &amp;lt;property name=&quot;src&quot; location=&quot;src&quot; /&amp;gt;&lt;br /&gt;
2:&amp;nbsp; &amp;lt;property name=&quot;bin&quot; location=&quot;bin&quot; /&amp;gt;&amp;nbsp; 3:&amp;nbsp; &amp;lt;property name=&quot;libs&quot; location=&quot;lib&quot; /&amp;gt;&lt;br /&gt;
3:&amp;nbsp; &amp;lt;path id=&quot;class.path&quot;&amp;gt;&lt;br /&gt;
4:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;pathelement location=&quot;${libs}/testng-6.2.jar&quot; /&amp;gt;&lt;br /&gt;
5:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;pathelement location=&quot;${libs}/selenium-java-client-driver.jar&quot; /&amp;gt;&lt;br /&gt;
6:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;pathelement location=&quot;${libs}/selenium-server-standalone-2.6.0.jar&quot; /&amp;gt;&lt;br /&gt;
7:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;pathelement location=&quot;${bin}&quot; /&amp;gt;&lt;br /&gt;
8:&amp;nbsp; &amp;lt;/path&amp;gt; &lt;br /&gt;
&lt;div align=&quot;left&quot;&gt;
&lt;br /&gt;
&lt;hr /&gt;
&lt;/div&gt;
&lt;style type=&quot;text/css&quot;&gt;
&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;&lt;br /&gt;.csharpcode, .csharpcode pre&lt;br /&gt;{&lt;br /&gt; font-size: small;&lt;br /&gt; color: black;&lt;br /&gt; font-family: consolas, &quot;Courier New&quot;, courier, monospace;&lt;br /&gt; background-color: #ffffff;&lt;br /&gt; /*white-space: pre;*/&lt;br /&gt;}&lt;br /&gt;.csharpcode pre { margin: 0em; }&lt;br /&gt;.csharpcode .rem { color: #008000; }&lt;br /&gt;.csharpcode .kwrd { color: #0000ff; }&lt;br /&gt;.csharpcode .str { color: #006080; }&lt;br /&gt;.csharpcode .op { color: #0000c0; }&lt;br /&gt;.csharpcode .preproc { color: #cc6633; }&lt;br /&gt;.csharpcode .asp { background-color: #ffff00; }&lt;br /&gt;.csharpcode .html { color: #800000; }&lt;br /&gt;.csharpcode .attr { color: #ff0000; }&lt;br /&gt;.csharpcode .alt &lt;br /&gt;{&lt;br /&gt; background-color: #f4f4f4;&lt;br /&gt; width: 100%;&lt;br /&gt; margin: 0em;&lt;br /&gt;}&lt;br /&gt;.csharpcode .lnum { color: #606060; }
&lt;/style&gt;&lt;br /&gt;
&lt;h5 align=&quot;left&quot;&gt;


Final XML&lt;/h5&gt;
&lt;br /&gt;
&lt;div align=&quot;left&quot;&gt;
Hence the final XML, after defining project name etc, it should look like this below&lt;/div&gt;
&lt;br /&gt;
1:&amp;nbsp; &amp;lt;project basedir=&quot;.&quot; default=&quot;runTest&quot; name=&quot;Ant file for TestNG&quot;&amp;gt;&lt;br /&gt;
2:&amp;nbsp;&amp;nbsp; &lt;br /&gt;
3:&amp;nbsp; &amp;lt;property name=&quot;src&quot; location=&quot;src&quot; /&amp;gt;&lt;br /&gt;
4:&amp;nbsp; &amp;lt;property name=&quot;bin&quot; location=&quot;bin&quot; /&amp;gt;&lt;br /&gt;
5:&amp;nbsp; &amp;lt;property name=&quot;libs&quot; location=&quot;lib&quot; /&amp;gt;&lt;br /&gt;
6:&amp;nbsp;&amp;nbsp; &lt;br /&gt;
7:&amp;nbsp; &amp;lt;path id=&quot;class.path&quot;&amp;gt;&lt;br /&gt;
8:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;pathelement location=&quot;${libs}/testng-6.2.jar&quot; /&amp;gt;&lt;br /&gt;
9:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;pathelement location=&quot;${libs}/selenium-java-client-driver.jar&quot; /&amp;gt;&lt;br /&gt;
10:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;pathelement location=&quot;${libs}/selenium-server-standalone-2.6.0.jar&quot; /&amp;gt;&lt;br /&gt;
11:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;pathelement location=&quot;${bin}&quot; /&amp;gt;&lt;br /&gt;
12:&amp;nbsp; &amp;lt;/path&amp;gt;&lt;br /&gt;
13:&amp;nbsp;&amp;nbsp; &lt;br /&gt;
14:&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;taskdef name=&quot;testng&quot; classname=&quot;org.testng.TestNGAntTask&quot;&amp;gt;&lt;br /&gt;
15:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;classpath&amp;gt;&lt;br /&gt;
16:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;pathelement location=&quot;lib/testng-6.2.jar&quot;/&amp;gt;&lt;br /&gt;
17:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/classpath&amp;gt;&lt;br /&gt;
18:&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/taskdef&amp;gt;&lt;br /&gt;
19:&amp;nbsp;&amp;nbsp;&amp;nbsp; &lt;br /&gt;
20:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;target name=&quot;runTest&quot;&amp;gt;&lt;br /&gt;
21:&amp;nbsp;&amp;nbsp; &lt;br /&gt;
22:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;mkdir dir=&quot;testng_output&quot;/&amp;gt;&amp;lt;!-- Create the output directory. --&amp;gt;&lt;br /&gt;
23:&amp;nbsp;&amp;nbsp; &lt;br /&gt;
24:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;testng outputdir=&quot;testng_output&quot; classpathref=&quot;class.path&quot;&amp;gt; &lt;br /&gt;
25:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xmlfileset dir=&quot;.&quot; includes=&quot;TestNG1.xml&quot;/&amp;gt; &lt;br /&gt;
26:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;xmlfileset dir=&quot;.&quot; includes=&quot;TestNG2.xml&quot;/&amp;gt; &lt;br /&gt;
27:&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/testng&amp;gt;&lt;br /&gt;
28:&amp;nbsp;&amp;nbsp; &lt;br /&gt;
29:&amp;nbsp;&amp;nbsp;&amp;nbsp; &amp;lt;/target&amp;gt;&lt;br /&gt;
30:&amp;nbsp; &amp;lt;/project&amp;gt; &lt;br /&gt;
&lt;div align=&quot;left&quot; class=&quot;csharpcode&quot;&gt;
&lt;br /&gt;
Now to execute this ant file, go to the directory where the build.xml resides in a new command line window, And then enter command “ant” and ant will execute the testng tests. If your ant file is having different name than build.xml, then you need to run command “ant –f &amp;lt; yourfilename&amp;gt;” to run the testng tests. Since we defined the default task is “runTest” in project attributes, running ant without specifing target name will execute default target (here runTest). For more options on ant command check this link for &lt;a href=&quot;http://ant.apache.org/manual/running.html&quot; target=&quot;_blank&quot;&gt;running ant&lt;/a&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/7818673813815740672/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2011/10/executing-selenium-testng-tests-using.html#comment-form' title='0 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/7818673813815740672'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/7818673813815740672'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2011/10/executing-selenium-testng-tests-using.html' title='Executing Selenium TestNG tests using ANT'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjIXgi65_fwbf2FqWs4JCbfTAbZuaVZV3TuW5o8lHivamETJ95UvJuMkSVYTayLxk20S2US0UXaS4f69B9hNK8AkEend4iSGRwG2UAbnn7cl5AQ14mUlICI7j7J6dm-AFbQdjHuinnfx0eu/s72-c/?imgmax=800" height="72" width="72"/><thr:total>0</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-20674103116153781</id><published>2011-10-24T13:30:00.001+01:00</published><updated>2013-09-07T00:12:25.354+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="automation"/><category scheme="http://www.blogger.com/atom/ns#" term="Commandline"/><category scheme="http://www.blogger.com/atom/ns#" term="Selenium"/><category scheme="http://www.blogger.com/atom/ns#" term="TestNG"/><title type='text'>Running Selenium TestNG test from command line</title><content type='html'>&lt;div align=&quot;justify&quot;&gt;
When I tried to run TestNG command from command line, I get following error. This is mainly because java cannot find class path and jar file of TestNG&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
&lt;table border=&quot;1&quot; height=&quot;209&quot; style=&quot;width: 621px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;         &lt;td width=&quot;607&quot;&gt;&lt;pre&gt;&lt;b&gt;&lt;span style=&quot;color: #0000a0;&quot;&gt;C:\Selenium\Selenium_tests\DemoProject &lt;/span&gt;&lt;/b&gt;&lt;i&gt;&lt;span style=&quot;color: #a40000;&quot;&gt;java org.testng.TestNg&lt;/span&gt;&lt;/i&gt;
Exception in thread &quot;main&quot; java.lang.NoClassDefFoundError: org/testng/TestNg
Caused by: java.lang.ClassNotFoundException: org.testng.TestNg
        at java.net.URLClassLoader$1.run(Unknown Source)
        at java.security.AccessController.doPrivileged(Native Method)
        at java.net.URLClassLoader.findClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
        at sun.misc.Launcher$AppClassLoader.loadClass(Unknown Source)
        at java.lang.ClassLoader.loadClass(Unknown Source)
Could not find the main class: org.testng.TestNg.  Program will exit.&lt;/pre&gt;
&lt;pre&gt;&lt;b&gt;&lt;span style=&quot;color: #0000a0;&quot;&gt;C:\Selenium\Selenium_tests\DemoProject &lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;
&lt;/td&gt;      &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
So below are the steps to get it working&lt;/div&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;&lt;br /&gt;
&lt;div align=&quot;justify&quot;&gt;
1. Navigate to directory of your project (if you are using Eclipse IDE).Create and set a path variable named “ProjectPath” by entering following command. Do echo command to check what is the value that we just set is right&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
&lt;table border=&quot;1&quot; style=&quot;width: 595px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;br /&gt;        &lt;td width=&quot;593&quot;&gt;&lt;br /&gt;
&lt;pre&gt;&lt;b&gt;&lt;span style=&quot;color: #0000a0;&quot;&gt;C:\Selenium\Selenium_tests\DemoProject &lt;/span&gt;&lt;/b&gt;&lt;i&gt;&lt;span style=&quot;color: #a40000;&quot;&gt;set ProjectPath=C:\Selenium\Seleni&lt;/span&gt;&lt;/i&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;i&gt;&lt;span style=&quot;color: #a40000;&quot;&gt;um_tests\DemoProject&lt;/span&gt;&lt;/i&gt;&lt;b&gt;&lt;span style=&quot;color: #0000a0;&quot;&gt;&amp;nbsp;&lt;/span&gt;&lt;/b&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;b&gt;&lt;span style=&quot;color: #0000a0;&quot;&gt;C:\Selenium\Selenium_tests\DemoProject &lt;/span&gt;&lt;/b&gt;&lt;i&gt;&lt;span style=&quot;color: #a40000;&quot;&gt;echo %ProjectPath%&lt;/span&gt;&lt;/i&gt;
&quot;C:\Selenium\Selenium_tests\DemoProject&quot;&lt;/pre&gt;
&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
2.&amp;nbsp; Now we after setting this project path, we need to create classpath that points to selenium/Testng class files and jar files along with testng jar file. My project setup is&amp;nbsp; like below and I keep jar files in folder called lib and eclipse creates complied classes in directory called bin automatically when you execute your test cases from eclipse&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1UGc8KQwgm9seQAnmBg-qXqNDI4Ic6SypaMreKYdzruC730t1CRw5RLY-9M74ZB_OrQawqQc_yAO8mrgAAUMOwK06Gipy4H9Dg-JgF-h5zXKXExKeKAklsibpvBnc3p6kZRH9i5ehLqv4/s1600-h/image14.png&quot;&gt;&amp;nbsp;&lt;/a&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjFbcr0LZsjlVrJSxE8eViyXGbai0zBtyoAVDvmOvGfxGRItLDjzlZoKGoMFnX3gGt3EzF49bfQdr9Vl5RM-h_A7dLrgA0aYx51E8FwpAxxZgO98rHjxUlMoqDo3PRtpjnvXyuYrkNwy0Z6/s1600-h/image15.png&quot;&gt;&lt;img alt=&quot;image&quot; border=&quot;0&quot; height=&quot;219&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1kZztRRaw5nfm5ZJaHqblWB8k6NosTaQKzfpFjnM33hJkoirokTN8N558VVhqQRwZ5H7qVwFVGD7U_IFv0gb9rQss6het303NmJkD-mX64oBYFFTd7HpyV_-8SrraM67xTCNcMHsaXuje//?imgmax=800&quot; style=&quot;border-width: 0px; display: inline; margin-left: 0px; margin-right: 0px;&quot; title=&quot;image&quot; width=&quot;424&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
Below is command to set the classpath for jars in lib folder and binary classes/folders in bin folder and do a echo to check the path that is been set&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
&lt;table border=&quot;1&quot; style=&quot;width: 600px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;br /&gt;        &lt;td width=&quot;598&quot;&gt;&lt;pre&gt;&lt;b&gt;&lt;span style=&quot;color: #0000a0;&quot;&gt;C:\Selenium\Selenium_tests\DemoProject &lt;/span&gt;&lt;/b&gt;&lt;i&gt;&lt;span style=&quot;color: #a40000;&quot;&gt;set classpath=%ProjectPath%&lt;/span&gt;&lt;/i&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;i&gt;&lt;span style=&quot;color: #a40000;&quot;&gt;\bin;%ProjectPath%\Lib\*&lt;/span&gt;&lt;/i&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;b&gt;&lt;span style=&quot;color: #0000a0;&quot;&gt;C:\Selenium\Selenium_tests\DemoProject &lt;/span&gt;&lt;/b&gt;&lt;i&gt;&lt;span style=&quot;color: #a40000;&quot;&gt;echo %classpath%&lt;/span&gt;&lt;/i&gt;
C:\Selenium\Selenium_tests\DemoProject\bin;C:\Selenium\Selenium_tes&lt;/pre&gt;
&lt;pre&gt;ts\DemoProject\Lib\*&lt;/pre&gt;
&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
3. Now execute the java command for TestNG as shown below &lt;/div&gt;
&lt;div align=&quot;justify&quot;&gt;
&lt;table border=&quot;1&quot; style=&quot;width: 603px;&quot;&gt;&lt;tbody&gt;
&lt;tr&gt;&lt;br /&gt;        &lt;td width=&quot;601&quot;&gt;&lt;br /&gt;
&lt;pre&gt;&lt;b&gt;&lt;span style=&quot;color: #0000a0;&quot;&gt;C:\Selenium\Selenium_tests\DemoProject &lt;/span&gt;&lt;/b&gt;&lt;i&gt;&lt;span style=&quot;color: #a40000;&quot;&gt;java org.testng.TestNG&amp;nbsp;&lt;/span&gt;&lt;/i&gt;&lt;/pre&gt;
&lt;pre&gt;&lt;i&gt;&lt;span style=&quot;color: #a40000;&quot;&gt;%ProjectPath%\IEandFirefoxTests.xml&lt;/span&gt;&lt;/i&gt;&lt;/pre&gt;
&lt;br /&gt;
&lt;pre&gt;&lt;i&gt;&lt;span style=&quot;color: #a40000;&quot;&gt;&lt;/span&gt;&lt;/i&gt;[TestNG] Running:
  C:\Selenium\Selenium_tests\DemoProject\IEandFirefoxTests.xml
===============================================
IEandFirefox
Total tests run: 6, Failures: 0, Skips: 6
Configuration Failures: 4, Skips: 12
===============================================&lt;/pre&gt;
&lt;/td&gt;&lt;br /&gt;      &lt;/tr&gt;
&lt;/tbody&gt;&lt;/table&gt;
&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/20674103116153781/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2011/10/running-selenium-testng-test-from.html#comment-form' title='9 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/20674103116153781'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/20674103116153781'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2011/10/running-selenium-testng-test-from.html' title='Running Selenium TestNG test from command line'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEg1kZztRRaw5nfm5ZJaHqblWB8k6NosTaQKzfpFjnM33hJkoirokTN8N558VVhqQRwZ5H7qVwFVGD7U_IFv0gb9rQss6het303NmJkD-mX64oBYFFTd7HpyV_-8SrraM67xTCNcMHsaXuje/s72-c/?imgmax=800" height="72" width="72"/><thr:total>9</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-5364152343687195884</id><published>2010-05-07T10:54:00.002+01:00</published><updated>2013-05-13T11:11:59.068+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Excel Reports"/><category scheme="http://www.blogger.com/atom/ns#" term="Quality Center"/><category scheme="http://www.blogger.com/atom/ns#" term="Test Management"/><title type='text'>How to retrieve the test sets - test instances - results within particular folder/path in Quality Center</title><content type='html'>&lt;div style=&quot;text-align: justify;&quot;&gt;Many times , you would be running the tests in multiple test sets and with multiple instances. Those multiple test sets would be in different folders under and under different&amp;nbsp;hierarchy&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Quality center has option to get this information using Analysis graphs, and thus you would be able to find what is the progress of each test set. But is has its own limitations. Like, if you want to find which test in each of sets is failed, or who has been the responsible tester for those tests , or any more information, then we are handicapped using Analysis reports.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Well , if you learn the excel reports, you life would be made easy. I have&amp;nbsp;briefly&amp;nbsp;mentioned on &lt;a href=&quot;http://qtp-automate.blogspot.com/2010/05/how-to-retrieve-requirement-test-case.html&quot;&gt;How to access excel reports&lt;/a&gt; in one of previous blog&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;So how shall we do go ahead?&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;Let me explain how the test sets, test lab folders, test cases are arranged. Below diagram from Quality Help file shows the Entity relationship diagram&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMkea7CNsQmBOahzsgWoFvKM2Lcm8YsKicuLPSE7EltmrXWN6tOZJOmjgaNZLnrch_UO17Z_NXhgit2eUOCwCBF6vZ_JxcPJBsz9Ym_dwFRou5EKYcBermRFUUsg0rYGycH1ETMSd0rWAW/s1600/QC+TestLab.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;360&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMkea7CNsQmBOahzsgWoFvKM2Lcm8YsKicuLPSE7EltmrXWN6tOZJOmjgaNZLnrch_UO17Z_NXhgit2eUOCwCBF6vZ_JxcPJBsz9Ym_dwFRou5EKYcBermRFUUsg0rYGycH1ETMSd0rWAW/s640/QC+TestLab.JPG&quot; width=&quot;640&quot; /&gt;&lt;/a&gt;&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The&amp;nbsp;TESTCYCL&amp;nbsp;table is the one that stores test set details. Hence it has information on instances of design tests within test set. If you not aware of instance, Instance is use of a test in a test set. If the test set contains a test more than once , then it will have same numbers of instances in the test set. This value is stored in column TC_TEST_INSTANCE column of TESTCYCL table.&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;The TEST table&amp;nbsp;contains&amp;nbsp;all the tests that are defined in test plan. The main and bit complex folder is the one that stores the path. It is CYCLE table, where it contain entry for each folder that is created in tree view. But how is the tree structure of quality center folder stored?Each row in this table corresponds to folder and each of them have a&amp;nbsp;Father ID&amp;nbsp;indicating ID of another folder&amp;nbsp;under which&amp;nbsp;it falls.&lt;br /&gt;
&lt;br /&gt;
Suppose we have folder structure like&lt;br /&gt;
Folder1/Folder2/Folder3/Folder4&lt;br /&gt;
Then &amp;nbsp;for&amp;nbsp;folder1&lt;br /&gt;
ID = 1 , Father ID = 0&lt;br /&gt;
For folder 2&lt;br /&gt;
ID = 2, Father ID = ID of folder1 = 1&lt;br /&gt;
For folder 3&lt;br /&gt;
ID = 3, Father ID = ID of folder2 = 2&lt;br /&gt;
etc.&lt;br /&gt;
&lt;br /&gt;
Hence the table has to be self joined to retrieve exact test cases/sets within a folder.&lt;br /&gt;
&lt;br /&gt;
&lt;/div&gt;&lt;div style=&quot;text-align: justify;&quot;&gt;From the diagram, we can easily write down the following join conditions&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;TESTCYCL.TC_CYCLE_ID = CYCLE.CY_CYCLE_ID&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;TEST.TS_TEST_ID = TESTCYCL.TC_TEST_ID&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Now say you want to retrieve all the test sets/cases within Folder2 till the level of folder 4. Here you have 4 levels of folder. Assume for lowest level Folder4 as representing z, then folder3 as y, then folder2 as x, &amp;nbsp;then folder1 as w&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-size: 12px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;Then we have write the self joins as below&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;and CYCLE.CY_FOLDER_ID = z.CF_item_id&lt;br /&gt;
and z.cf_father_id = y.CF_item_id&lt;br /&gt;
and y.cf_father_id = x.CF_item_id&lt;br /&gt;
and x.cf_father_id = w.CF_item_id&lt;br /&gt;
and x.cf_item_name = &#39;Folder2&#39;&lt;br /&gt;
and w.cf_item_name = &#39;Folder1&#39;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;The final query would be&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;&lt;br /&gt;
&lt;/span&gt; &lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: inherit;&quot;&gt;select Test.TS_NAME as TestCase, TESTCYCL.TC_STATUS as Status,CYCLE.CY_CYCLE as TestSet, TESTCYCL.TC_ACTUAL_TESTER as Tester&lt;br /&gt;
from CYCLE,TEST,TESTCYCL,CYCL_FOLD z ,CYCL_FOLD y,&lt;br /&gt;
CYCL_FOLD x,CYCL_FOLD w&lt;br /&gt;
where TEST.TS_TEST_ID = TESTCYCL.TC_TEST_ID&lt;br /&gt;
and TESTCYCL.TC_CYCLE_ID = CYCLE.CY_CYCLE_ID&lt;br /&gt;
and CYCLE.CY_FOLDER_ID = z.CF_item_id&lt;br /&gt;
and z.cf_father_id = y.CF_item_id&lt;br /&gt;
and y.cf_father_id = x.CF_item_id&lt;br /&gt;
and x.cf_father_id = w.CF_item_id&lt;br /&gt;
and x.cf_item_name = &#39;Folder2&#39;&lt;br /&gt;
and w.cf_item_name = &#39;Folder1&#39;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Verdana, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Arial, Verdana, Helvetica, sans-serif; font-size: small;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/5364152343687195884/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2010/05/how-to-retrieve-test-sets-test.html#comment-form' title='1 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/5364152343687195884'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/5364152343687195884'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2010/05/how-to-retrieve-test-sets-test.html' title='How to retrieve the test sets - test instances - results within particular folder/path in Quality Center'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEjMkea7CNsQmBOahzsgWoFvKM2Lcm8YsKicuLPSE7EltmrXWN6tOZJOmjgaNZLnrch_UO17Z_NXhgit2eUOCwCBF6vZ_JxcPJBsz9Ym_dwFRou5EKYcBermRFUUsg0rYGycH1ETMSd0rWAW/s72-c/QC+TestLab.JPG" height="72" width="72"/><thr:total>1</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-214165405324122874</id><published>2010-05-05T20:35:00.001+01:00</published><updated>2013-08-28T21:42:05.096+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Excel Reports"/><category scheme="http://www.blogger.com/atom/ns#" term="Quality Center"/><category scheme="http://www.blogger.com/atom/ns#" term="Test Management"/><title type='text'>How to retrieve requirement - test case - linked defect using excel reports</title><content type='html'>&lt;div dir=&quot;ltr&quot; style=&quot;text-align: left;&quot; trbidi=&quot;on&quot;&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
QC 9.2 has feature called excel reports. This feature is very versatile as you can retrieve complex data which simple reports or graphs from QC will not be able to do. One of the report that may be useful for any testing project is to find which all defects are linked to test cases and these test cases are covering which of the requirements. This will give you data that can be used to address which defects are more&amp;nbsp;severely effecting your testing progress and resolving a defect what requirements/test cases you can quickly progress.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Here below is entity relationship diagram that you can find in HP quality center database reference. It is one of the help documentation&amp;nbsp;available&amp;nbsp;in QC.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
For folks who not sure how to access excel reports in QC , follow below steps you will be amazed to find this feature.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Login into QC with project and domain. Then click on Tools and next select excel reports. It will open up another window. In the top menu , there is + button which on clicking will open report. You can make that report public or private.&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
TEST - REQUIREMENT ER DIAGRAM&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;a href=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwMcdzXzcyEyfjZxIBMnm8NaS1SHikXPBWkyQ1mzMmiiqhfvXusQm4I4Ye0REvNVbFrm7OXuQt2Ah5hi5vNoMNtUkgAAqfLV2WxfVMsmNjaBaJ0UtD4o60rMi4z2BQUYwSGhWhiWJKanq6/s1600/QC+Test+linkage.JPG&quot; imageanchor=&quot;1&quot; style=&quot;margin-left: 1em; margin-right: 1em;&quot;&gt;&lt;img border=&quot;0&quot; height=&quot;258&quot; src=&quot;https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwMcdzXzcyEyfjZxIBMnm8NaS1SHikXPBWkyQ1mzMmiiqhfvXusQm4I4Ye0REvNVbFrm7OXuQt2Ah5hi5vNoMNtUkgAAqfLV2WxfVMsmNjaBaJ0UtD4o60rMi4z2BQUYwSGhWhiWJKanq6/s400/QC+Test+linkage.JPG&quot; width=&quot;400&quot; /&gt;&lt;/a&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;/div&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
So the box&amp;nbsp;highlighted&amp;nbsp;in Red is the table which stores Test details ( from Plan). &amp;nbsp;The TEST table is connected to Requirement (REQ) table via requirement coverage table REQ_COVER..&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
At the start , your query would be simple one as below which will retrieve test details&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div class=&quot;separator&quot; style=&quot;clear: both; text-align: justify;&quot;&gt;
Select * from TEST t&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Next we need join both REQ and REQ_COVER tables. Join condition between REQ and REQ_COVER is&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;rq_req_id = rc_req_id.&lt;/i&gt; Join condition between REQ_COVER and TEST is &lt;i&gt;rc_entity_id = ts_test_id and rc_entity_type = &#39;TEST&#39;&lt;/i&gt;. Using these lets construct below query&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;Select&amp;nbsp;&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;&lt;i&gt;r.rq_req_name, t.TS_NAME&lt;/i&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-family: &#39;Times New Roman&#39;; font-size: xx-small;&quot;&gt;&lt;i&gt;&amp;nbsp;from TEST t, REQ r, REQ_COVER rc&lt;/i&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;where rq_req_id = rc_req_id&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;and rc_entity_id = ts_test_id&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;i&gt;and rc_entity_type = &#39;TEST&#39;&lt;/i&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;b&gt;The above query will list all the tests and requirements attached to those tests.&lt;/b&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Next is how to find linked defects. Basically the defects are linked to tests which are pulled in the test sets of QC. We have to join test sets (TESTCYCL) to test (TEST) first, then join linked defects table LINK&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
Join between TESTCYCL and TEST tables is as below&amp;nbsp;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;&lt;i&gt;TEST..ts_test_id = TESTCYCL.tc_test_id&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;The join between test set (TESTCYCL) and LINK &amp;nbsp;is as below&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;&lt;i&gt;LINK.ln_entity_type = &#39;TESTCYCL&#39; and TESTCYCL.TC_TESTCYCL_ID = LINK.ln_entity_id&lt;/i&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;Here you can notice the condition &quot;&lt;i&gt;LINK.ln_entity_type = &#39;TESTCYCL&#39; &lt;/i&gt;&amp;nbsp;&quot; has value equated to TESTCYCL which is table name containing test sets. Basically if you link defects to test sets or tests within test set then, ln_entity_type will have the value TESTCYCL&amp;nbsp;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;So combining all the conditions we can make the query which will retrieve requirements/test cases/linked defects&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; font-family: &#39;Times New Roman&#39;; font-size: xx-small;&quot;&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;margin-bottom: 0px; margin-left: 0px; margin-right: 0px; margin-top: 0px; text-align: justify;&quot;&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;Select r.rq_req_name, 
t.TS_NAME,ln_bug_id from TEST t, REQ r, REQ_COVER rc, TESTCYCL tc, LINK 
l&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;where rq_req_id = 
rc_req_id&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;and rc_entity_id = 
ts_test_id&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;and rc_entity_type = 
&#39;TEST&#39;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;and t.ts_test_id = 
tc.tc_test_id&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;div class=&quot;MsoNormal&quot;&gt;
&lt;span style=&quot;color: navy; font-family: Arial; font-size: x-small;&quot;&gt;&lt;span style=&quot;font-size: 10pt;&quot;&gt;and l.ln_entity_type = 
&#39;TESTCYCL&#39;&lt;o:p&gt;&lt;/o:p&gt;&lt;/span&gt;&lt;/span&gt;&lt;/div&gt;
&lt;span style=&quot;color: navy; font-family: Arial; font-size: 10pt;&quot;&gt;and Tc.TC_TESTCYCL_ID = 
l.ln_entity_id&lt;/span&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;If you run the above query in excel reports, you should be able to retrieve the mapping of link defects - test cases- requirements.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;span class=&quot;Apple-style-span&quot; style=&quot;-webkit-border-horizontal-spacing: 2px; -webkit-border-vertical-spacing: 2px; font-family: Arial, Verdana, Helvetica, sans-serif; font-size: 12px;&quot;&gt;*Note : This will not retrieve those defects which are linked to test cases but the test cases are not covered to a requirement.&lt;/span&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;div style=&quot;text-align: left;&quot;&gt;
The other useful blogs related to Audit tables and QC history can be found in following locations&lt;/div&gt;
&lt;h2 style=&quot;text-align: left;&quot;&gt;
&lt;/h2&gt;
&lt;h3 style=&quot;text-align: left;&quot;&gt;
&lt;ol&gt;
&lt;li&gt;&lt;b&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2010/05/first-time-fix-failures-or-reopen.html&quot; target=&quot;_blank&quot;&gt;First time Fix faliures or Reopen defects&lt;/a&gt;&lt;/b&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2010/04/how-to-retrieve-quality-center-bug.html&quot; target=&quot;_blank&quot;&gt;How to retrieve Quality Center bug details and Audit tables information&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2013/08/qc-history-for-closed-defect-status.html&quot; target=&quot;_blank&quot;&gt;How to retrieve QC status history for closed defect&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href=&quot;http://qtp-automate.blogspot.co.uk/2010/05/how-to-retrieve-test-sets-test.html&quot; target=&quot;_blank&quot;&gt;How to retrieve test instances and test sets within particular folder&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;
&lt;/h3&gt;
&lt;/div&gt;
&lt;div style=&quot;text-align: justify;&quot;&gt;
&lt;br /&gt;&lt;/div&gt;
&lt;/div&gt;
</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/214165405324122874/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2010/05/how-to-retrieve-requirement-test-case.html#comment-form' title='7 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/214165405324122874'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/214165405324122874'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2010/05/how-to-retrieve-requirement-test-case.html' title='How to retrieve requirement - test case - linked defect using excel reports'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><media:thumbnail xmlns:media="http://search.yahoo.com/mrss/" url="https://blogger.googleusercontent.com/img/b/R29vZ2xl/AVvXsEiwMcdzXzcyEyfjZxIBMnm8NaS1SHikXPBWkyQ1mzMmiiqhfvXusQm4I4Ye0REvNVbFrm7OXuQt2Ah5hi5vNoMNtUkgAAqfLV2WxfVMsmNjaBaJ0UtD4o60rMi4z2BQUYwSGhWhiWJKanq6/s72-c/QC+Test+linkage.JPG" height="72" width="72"/><thr:total>7</thr:total></entry><entry><id>tag:blogger.com,1999:blog-7247480733244728924.post-387038418714305760</id><published>2010-05-02T07:19:00.005+01:00</published><updated>2013-05-13T11:11:59.067+01:00</updated><category scheme="http://www.blogger.com/atom/ns#" term="Excel Reports"/><category scheme="http://www.blogger.com/atom/ns#" term="Quality Center"/><category scheme="http://www.blogger.com/atom/ns#" term="Test Management"/><title type='text'>First time fix failures or Reopen defect from QC</title><content type='html'>In quality center, for your project analysis, it would be useful to find how many defects reopened. As you might be aware that , due to defects and not so good work from developers, your testing progress gets hampered. But how will you be able to quantify like the defects most of them were reopened and users had to do more of regression and testing? For this, metrics of Reopen defect is quite good and will justify that there was more of testing required than expected.&lt;br /&gt;
&lt;br /&gt;
&lt;a name=&#39;more&#39;&gt;&lt;/a&gt;&lt;br /&gt;
&lt;br /&gt;
In my previous blog&amp;nbsp;&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Trebuchet, &#39;Trebuchet MS&#39;, Arial, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #8e7cc3;&quot;&gt;&lt;a href=&quot;http://qtp-automate.blogspot.com/2010/04/how-to-retrieve-quality-center-bug.html&quot;&gt;How to retrieve Quality center bug details ?&lt;/a&gt;&amp;nbsp;,&amp;nbsp;&lt;/span&gt;&lt;/span&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;font-family: Trebuchet, &#39;Trebuchet MS&#39;, Arial, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #8e7cc3;&quot;&gt;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: black; font-family: &#39;Times New Roman&#39;; font-size: medium; line-height: normal;&quot;&gt;&lt;br /&gt;
&lt;/span&gt;&lt;/span&gt;&lt;/span&gt;&lt;br /&gt;
I have explained the information of Audit tables in QC. In case,if you are not aware of Audit tables, it would be worth going through it first.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
So how to find reopen defects? The audit_properties table as said before holds the properties of the QC entity for any action that happened. So when a defect gets a new status, for this action there is entry made in audit_log table saying an action is performed for the bug. &amp;nbsp;Next for this action, audit_properties table stores the properties that have been changed. &lt;br /&gt;
This means audit_entity column of audit log table will have value saying it is for BUG ( the table name of defects). and ap_field_name column of audit_properties will have the value of &amp;nbsp;BG_status ( the column in the defect table that stores Defect status). Hence the value for the column ap_new_value of audit properties table will have has Reopen( Check the exact text for your project for Reopen status. It may vary)&lt;br /&gt;
&lt;br /&gt;
Thus we have three conditions&lt;br /&gt;
&lt;i&gt;&lt;b&gt;1.&amp;nbsp;audit_log.AU_ENTITY_TYPE = &#39;BUG&#39;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;2. audit_properties.AP_FIELD_NAME = &#39;BG_STATUS&#39;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;3. audit_properties.AP_NEW_VALUE = &#39;Reopen&#39;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
As per relationship between Audit_log and audit_properties , we have following condition . You can check the Relationship Diagram in my previous blog&amp;nbsp;&lt;span class=&quot;Apple-style-span&quot; style=&quot;color: #8e7cc3; font-family: Trebuchet, &#39;Trebuchet MS&#39;, Arial, sans-serif; font-size: 12px; line-height: 18px;&quot;&gt;&lt;a href=&quot;http://qtp-automate.blogspot.com/2010/04/how-to-retrieve-quality-center-bug.html&quot;&gt;How to retrieve Quality center bug details ?&lt;/a&gt;&amp;nbsp;&lt;/span&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;audit_log.AU_ENTITY_ID = audit_properties.BG_BUG_ID&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;audit_properties.AP_ACTION_ID = audit_log.AU_ACTION_ID&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
Thus from above conditions you can find all the defects that have been reopened.&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
&lt;i&gt;&lt;b&gt;SELECT&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;Bug.bg_project,bug.BG_BUG_ID as Defect_ID&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;FROM BUG Bug, AUDIT_LOG , AUDIT_PROPERTIES&amp;nbsp;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;WHERE audit_log.AU_ENTITY_ID = Bug.BG_BUG_ID&amp;nbsp;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;and audit_log.AU_ENTITY_TYPE = &#39;BUG&#39; and&amp;nbsp;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;audit_properties.AP_ACTION_ID = audit_log.AU_ACTION_ID&amp;nbsp;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;and audit_properties.AP_FIELD_NAME = &#39;BG_STATUS&#39;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;i&gt;&lt;b&gt;and audit_properties.AP_NEW_VALUE = &#39;Reopen&#39;&lt;/b&gt;&lt;/i&gt;&lt;br /&gt;
&lt;br /&gt;
&lt;br /&gt;
*&amp;nbsp;&#39;BG_STATUS&#39; is default column in BUG table where the status of the defect is stored. But in many cases, or in your QC project , the status might have defined to be stored in some other column. You can try locate that field in BUG table when you have glance at it in QC excel reports, because user need to give appropiate name while setting up this.</content><link rel='replies' type='application/atom+xml' href='http://qtp-automate.blogspot.com/feeds/387038418714305760/comments/default' title='Post Comments'/><link rel='replies' type='text/html' href='http://qtp-automate.blogspot.com/2010/05/first-time-fix-failures-or-reopen.html#comment-form' title='4 Comments'/><link rel='edit' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/387038418714305760'/><link rel='self' type='application/atom+xml' href='http://www.blogger.com/feeds/7247480733244728924/posts/default/387038418714305760'/><link rel='alternate' type='text/html' href='http://qtp-automate.blogspot.com/2010/05/first-time-fix-failures-or-reopen.html' title='First time fix failures or Reopen defect from QC'/><author><name>Shambu</name><uri>http://www.blogger.com/profile/15379994217892108149</uri><email>noreply@blogger.com</email><gd:image rel='http://schemas.google.com/g/2005#thumbnail' width='16' height='16' src='https://img1.blogblog.com/img/b16-rounded.gif'/></author><thr:total>4</thr:total></entry></feed>