<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: Recovery Scenario Test Run Error: Item in list or menu not found</title>
	<atom:link href="http://relevantcodes.com/recovery-scenario-test-run-error-item-in-list-or-menu-not-found/feed/" rel="self" type="application/rss+xml" />
	<link>http://relevantcodes.com/recovery-scenario-test-run-error-item-in-list-or-menu-not-found/</link>
	<description>A Test Development Resource for HP QuickTest Professional.</description>
	<lastBuildDate>Thu, 09 Feb 2012 12:13:41 +0000</lastBuildDate>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
	<item>
		<title>By: Anonymous</title>
		<link>http://relevantcodes.com/recovery-scenario-test-run-error-item-in-list-or-menu-not-found/#comment-54478</link>
		<dc:creator>Anonymous</dc:creator>
		<pubDate>Thu, 19 Jan 2012 05:14:48 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=1542#comment-54478</guid>
		<description>can you please give some more example for recovery scenario because i tried for pop up window and object state. . .  so please give some simple example for objects present in the application. . .</description>
		<content:encoded><![CDATA[<p>can you please give some more example for recovery scenario because i tried for pop up window and object state. . .  so please give some simple example for objects present in the application. . .</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anshoo Arora</title>
		<link>http://relevantcodes.com/recovery-scenario-test-run-error-item-in-list-or-menu-not-found/#comment-54024</link>
		<dc:creator>Anshoo Arora</dc:creator>
		<pubDate>Thu, 12 Jan 2012 16:46:05 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=1542#comment-54024</guid>
		<description>Amit, a very good way to avoid &quot;Object Not Found&quot; is by using the .Exist method.</description>
		<content:encoded><![CDATA[<p>Amit, a very good way to avoid &#8220;Object Not Found&#8221; is by using the .Exist method.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit</title>
		<link>http://relevantcodes.com/recovery-scenario-test-run-error-item-in-list-or-menu-not-found/#comment-53551</link>
		<dc:creator>Amit</dc:creator>
		<pubDate>Thu, 05 Jan 2012 10:06:24 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=1542#comment-53551</guid>
		<description>Hi Anshoo,
Code I have written for recovery scenario is as below:
Function Recovery_ObjectNotFound(Obj, Method, Arguments, retVal)
   msgbox err.number
   msgbox err.source
   msgbox err.description
      
End Function
But when this function is executed then msgbox shows 0 for error number and blank for source and description. It means that err object is getting reset. As on next line in script also same values are shown</description>
		<content:encoded><![CDATA[<p>Hi Anshoo,<br />
Code I have written for recovery scenario is as below:<br />
Function Recovery_ObjectNotFound(Obj, Method, Arguments, retVal)<br />
   msgbox err.number<br />
   msgbox err.source<br />
   msgbox err.description</p>
<p>End Function<br />
But when this function is executed then msgbox shows 0 for error number and blank for source and description. It means that err object is getting reset. As on next line in script also same values are shown</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Amit</title>
		<link>http://relevantcodes.com/recovery-scenario-test-run-error-item-in-list-or-menu-not-found/#comment-53543</link>
		<dc:creator>Amit</dc:creator>
		<pubDate>Thu, 05 Jan 2012 05:15:44 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=1542#comment-53543</guid>
		<description>Hi Anshoo,
I am new to QTP, some times i get Object not found test run error from QTP. In my script I have added some checks which skips rest of lines if any step fails, but if i get an error like this I would like to log it in my result array so that it will be present in my report excel. SO can you tell me how to capture those errors and their bodies? and also custom function which I have written to record my results can be called from recovery functions to log results in my result array?</description>
		<content:encoded><![CDATA[<p>Hi Anshoo,<br />
I am new to QTP, some times i get Object not found test run error from QTP. In my script I have added some checks which skips rest of lines if any step fails, but if i get an error like this I would like to log it in my result array so that it will be present in my report excel. SO can you tell me how to capture those errors and their bodies? and also custom function which I have written to record my results can be called from recovery functions to log results in my result array?</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: vijayalakshmi</title>
		<link>http://relevantcodes.com/recovery-scenario-test-run-error-item-in-list-or-menu-not-found/#comment-42548</link>
		<dc:creator>vijayalakshmi</dc:creator>
		<pubDate>Thu, 27 Oct 2011 05:16:02 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=1542#comment-42548</guid>
		<description>hi,i saw this example but am having one doubt &#039;#&quot; this one is used in script am not undestand this one....</description>
		<content:encoded><![CDATA[<p>hi,i saw this example but am having one doubt &#8216;#&#8221; this one is used in script am not undestand this one&#8230;.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anshoo Arora</title>
		<link>http://relevantcodes.com/recovery-scenario-test-run-error-item-in-list-or-menu-not-found/#comment-37669</link>
		<dc:creator>Anshoo Arora</dc:creator>
		<pubDate>Fri, 30 Sep 2011 02:38:07 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=1542#comment-37669</guid>
		<description>Naveen: depending on how you have created your framework (actions vs. function libraries) you can use a Class_Terminate() event to run after each actions completes. I am providing some sample code, but please modify it for your usage:

&lt;pre&gt;
Class ActionTerminate
    Private Sub Class_Terminate()
        If Reporter.RunStatus = micFail Or Err.Number  0 Then
            Err.Clear
            
            Environment.Value(&quot;strResultparam&quot;)=StrScenarioName1 &amp; &quot;&#124;&quot; &amp; strResFailVal
        Else
            Environment.Value(&quot;strResultparam&quot;)=StrScenarioName1 &amp; &quot;&#124;&quot; &amp; strResPassVal
        End If
    End Sub
End Class
&lt;/pre&gt;

And yes, please use Error Handling where required: Conditional statements, On Error Resume Next, Recovery Scenarios etc.</description>
		<content:encoded><![CDATA[<p>Naveen: depending on how you have created your framework (actions vs. function libraries) you can use a Class_Terminate() event to run after each actions completes. I am providing some sample code, but please modify it for your usage:</p>
<pre>
Class ActionTerminate
    Private Sub Class_Terminate()
        If Reporter.RunStatus = micFail Or Err.Number  0 Then
            Err.Clear

            Environment.Value("strResultparam")=StrScenarioName1 &amp; "|" &amp; strResFailVal
        Else
            Environment.Value("strResultparam")=StrScenarioName1 &amp; "|" &amp; strResPassVal
        End If
    End Sub
End Class
</pre>
<p>And yes, please use Error Handling where required: Conditional statements, On Error Resume Next, Recovery Scenarios etc.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Naveen Khunteta</title>
		<link>http://relevantcodes.com/recovery-scenario-test-run-error-item-in-list-or-menu-not-found/#comment-37401</link>
		<dc:creator>Naveen Khunteta</dc:creator>
		<pubDate>Tue, 27 Sep 2011 13:55:00 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=1542#comment-37401</guid>
		<description>Dear Anshoo,
I have a problem with my framework. Hope u can give a appropriate solution regarding Recovery Scenrios.
--suppose I am going to execute 20 test cases through the driver script with the Execution_Flag=Y defined in Test Data sheet. 
--for each scenario, I am maintaining a Environment Variable to capture the Scenrio_Name and Result like : 

-----Environment.Value(&quot;strResultparam&quot;)=StrScenarioName1 &amp; &quot;&#124;&quot; &amp; strResPassVal  (If this case is passed)
----Environment.Value(&quot;strResultparam&quot;)=StrScenarioName1 &amp; &quot;&#124;&quot; &amp; strResFailVal (If case is failed)

at the end of 20th test case execution, the environment variables would be like:
&gt;Environment.Value(&quot;strResultparam&quot;)=Environment.Value(&quot;strResultparam&quot;) &amp; &quot;##&quot; &amp; StrScenarioName1 &amp; &quot;&#124;&quot; &amp; strResFailVal

--Like:::Environment.Value(&quot;strResultparam&quot;)=verifyLogin&#124;Pass##verifyHomePage&#124;Pass........................VerifyAddUser&#124;Fail.....and so on..

&gt;&gt;Now at the end of 20th test case execution, I am calling a  &quot;Fn_WriteResult&quot;  function in which I am passing this Env. variable as a parameter.
&gt;&gt;In This function, I have written a code which will seperate the Env. Variable on the basis of ## and will return an array like below:

Public Function fn_WriteResults1(byval  strRes) 
ArrTestData=Split(strTestData,&quot;##&quot;)

And after that, I am just entering the elements of this array into an excel sheet like below:
---------------------------------------------------------------
ScenarioName                          Result
verifyLogin                                   Pass
verifyHomePage                         Pass
&#039;
&#039;
&#039;
&#039;
VerifyAddUser                             Fail
---------------------------------------------------------------

Now my problem is, in this approach: I am collecting values and concatenating the multiple values on the basis of test case scenarios and Pass/Fail result.
But Suppose, some of the sceanrio(suppose 5th scenario) is not able to execute just coz of Object not found error or any run time error. Hence I need to ignore that step and want to come to the next step so that, my env variable collection would not corrupt. 

Please suggest any solutions, How can I avoide such run time errors. Can I use On error/Go to 0  for each scenarios?
or any other solution?





Once all the scenarios have been executed</description>
		<content:encoded><![CDATA[<p>Dear Anshoo,<br />
I have a problem with my framework. Hope u can give a appropriate solution regarding Recovery Scenrios.<br />
&#8211;suppose I am going to execute 20 test cases through the driver script with the Execution_Flag=Y defined in Test Data sheet.<br />
&#8211;for each scenario, I am maintaining a Environment Variable to capture the Scenrio_Name and Result like : </p>
<p>&#8212;&#8211;Environment.Value(&#8220;strResultparam&#8221;)=StrScenarioName1 &amp; &#8220;|&#8221; &amp; strResPassVal  (If this case is passed)<br />
&#8212;-Environment.Value(&#8220;strResultparam&#8221;)=StrScenarioName1 &amp; &#8220;|&#8221; &amp; strResFailVal (If case is failed)</p>
<p>at the end of 20th test case execution, the environment variables would be like:<br />
&gt;Environment.Value(&#8220;strResultparam&#8221;)=Environment.Value(&#8220;strResultparam&#8221;) &amp; &#8220;##&#8221; &amp; StrScenarioName1 &amp; &#8220;|&#8221; &amp; strResFailVal</p>
<p>&#8211;Like:::Environment.Value(&#8220;strResultparam&#8221;)=verifyLogin|Pass##verifyHomePage|Pass&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;&#8230;VerifyAddUser|Fail&#8230;..and so on..</p>
<p>&gt;&gt;Now at the end of 20th test case execution, I am calling a  &#8220;Fn_WriteResult&#8221;  function in which I am passing this Env. variable as a parameter.<br />
&gt;&gt;In This function, I have written a code which will seperate the Env. Variable on the basis of ## and will return an array like below:</p>
<p>Public Function fn_WriteResults1(byval  strRes)<br />
ArrTestData=Split(strTestData,&#8221;##&#8221;)</p>
<p>And after that, I am just entering the elements of this array into an excel sheet like below:<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;<br />
ScenarioName                          Result<br />
verifyLogin                                   Pass<br />
verifyHomePage                         Pass<br />
&#8216;<br />
&#8216;<br />
&#8216;<br />
&#8216;<br />
VerifyAddUser                             Fail<br />
&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;</p>
<p>Now my problem is, in this approach: I am collecting values and concatenating the multiple values on the basis of test case scenarios and Pass/Fail result.<br />
But Suppose, some of the sceanrio(suppose 5th scenario) is not able to execute just coz of Object not found error or any run time error. Hence I need to ignore that step and want to come to the next step so that, my env variable collection would not corrupt. </p>
<p>Please suggest any solutions, How can I avoide such run time errors. Can I use On error/Go to 0  for each scenarios?<br />
or any other solution?</p>
<p>Once all the scenarios have been executed</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Jayaprakash</title>
		<link>http://relevantcodes.com/recovery-scenario-test-run-error-item-in-list-or-menu-not-found/#comment-36616</link>
		<dc:creator>Jayaprakash</dc:creator>
		<pubDate>Tue, 20 Sep 2011 10:02:45 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=1542#comment-36616</guid>
		<description>The way of explaining the &quot;Recover operation-Function call&quot; is good
Thank u</description>
		<content:encoded><![CDATA[<p>The way of explaining the &#8220;Recover operation-Function call&#8221; is good<br />
Thank u</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anshoo Arora</title>
		<link>http://relevantcodes.com/recovery-scenario-test-run-error-item-in-list-or-menu-not-found/#comment-35745</link>
		<dc:creator>Anshoo Arora</dc:creator>
		<pubDate>Tue, 13 Sep 2011 03:14:37 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=1542#comment-35745</guid>
		<description>Dhana:  Please see &lt;a href=&quot;http://knowledgeinbox.com/downloads/general/system-lockout-api/&quot; rel=&quot;nofollow&quot;&gt;here&lt;/a&gt;</description>
		<content:encoded><![CDATA[<p>Dhana:  Please see <a href="http://knowledgeinbox.com/downloads/general/system-lockout-api/" rel="nofollow">here</a></p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Anshoo Arora</title>
		<link>http://relevantcodes.com/recovery-scenario-test-run-error-item-in-list-or-menu-not-found/#comment-35742</link>
		<dc:creator>Anshoo Arora</dc:creator>
		<pubDate>Tue, 13 Sep 2011 03:01:42 +0000</pubDate>
		<guid isPermaLink="false">http://relevantcodes.com/?p=1542#comment-35742</guid>
		<description>Dhana: There are several ways you can achieve this and there is a technique I love a lot, which is from Tarun&#039;s book - which I can&#039;t share with you at this point of time.  We must wait until it is officially published.  In the meantime, you can try the following:

&lt;pre&gt;
Public Sub OnEventFail(ByVal capturePath, ByVal terminateApp)
    If capturePath &lt;&gt; &quot;&quot; Then
        Desktop.CaptureBitmap capturePath, True
    End If

    If terminateApp Then
        &#039;depending on type of app, execute terminate procedure
    End If
End Sub
&lt;/pre&gt;</description>
		<content:encoded><![CDATA[<p>Dhana: There are several ways you can achieve this and there is a technique I love a lot, which is from Tarun&#8217;s book &#8211; which I can&#8217;t share with you at this point of time.  We must wait until it is officially published.  In the meantime, you can try the following:</p>
<pre>
Public Sub OnEventFail(ByVal capturePath, ByVal terminateApp)
    If capturePath <> "" Then
        Desktop.CaptureBitmap capturePath, True
    End If

    If terminateApp Then
        'depending on type of app, execute terminate procedure
    End If
End Sub
</pre>
]]></content:encoded>
	</item>
</channel>
</rss>

