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

<channel>
	<title>Software Programs</title>
	<atom:link href="http://ivreddy.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://ivreddy.com</link>
	<description>Technical Experiments in my career</description>
	<lastBuildDate>Tue, 16 Nov 2010 10:46:47 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>c sharp (c#) questions and answers</title>
		<link>http://ivreddy.com/c-sharp-questions-and-answers/</link>
		<comments>http://ivreddy.com/c-sharp-questions-and-answers/#comments</comments>
		<pubDate>Wed, 06 Oct 2010 07:09:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[c # ( c sharp)]]></category>
		<category><![CDATA[c#]]></category>

		<guid isPermaLink="false">http://ivreddy.com/?p=1947</guid>
		<description><![CDATA[<p>1. How to check whether a checkbox is checked or not in c sharp (c#)</p>
<p>if (checkBox1.Checked)</p>
<p>MessageBox.Show(&#8220;The checkbox1 is checked&#8221;);</p>
<p>if (checkBox1.Checked == false)</p>
<p>MessageBox.Show(&#8220;The checkbox1 is not checked&#8221;);</p>
<p>2.How to create a boolean array in c sharp (c#)</p>
<p>Boolean[] var = new Boolean[8];</p>
<p>3.How to replace string in c sharp (c#)</p>
<p>string str = &#8220;hai how r u&#8221;;</p>
<p>MessageBox.Show(str);        // o/p : hai <span style="color:#777"> . . . &#8594; Read More: <a href="http://ivreddy.com/c-sharp-questions-and-answers/">c sharp (c#) questions and answers</a></span>]]></description>
			<content:encoded><![CDATA[<p><strong>1. How to check whether a checkbox is checked or not in c sharp (c#)</strong></p>
<p>if (checkBox1.Checked)</p>
<p>MessageBox.Show(&#8220;The checkbox1 is checked&#8221;);</p>
<p>if (checkBox1.Checked == false)</p>
<p>MessageBox.Show(&#8220;The checkbox1 is not checked&#8221;);</p>
<p><strong>2.How to create a boolean array in c sharp (c#)</strong></p>
<p>Boolean[] var = new Boolean[8];</p>
<p><strong>3.How to replace string in c sharp (c#)</strong></p>
<p>string str = &#8220;hai how r u&#8221;;</p>
<p>MessageBox.Show(str);        // o/p : hai how r u</p>
<p>string newstr = str.Replace(&#8220;r u&#8221;, &#8220;do u do&#8221;);</p>
<p>MessageBox.Show(newstr);  // o/p : hai how do u do</p>
<p><strong>4.</strong><strong> how to take substring in c sharp (c#)</strong></p>
<p><strong> </strong></p>
<p>string str=&#8221;hai welcome&#8221;;</p>
<p>MessageBox.Show(str);        // o/p : hai welcome</p>
<p>string sub = str.Substring(0, 3);</p>
<p>MessageBox.Show(sub);       // o/p : hai</p>
<p><strong>5.</strong><strong> how to convert string to bool in c sharp (c#)</strong></p>
<p><strong> </strong></p>
<p>string str1 = &#8220;true&#8221;;</p>
<p>bool var = Convert.ToBoolean(str1);</p>
<p>if (var)</p>
<p>MessageBox.Show(&#8220;This is true&#8221;);</p>
<p><strong>6.</strong><strong> how to reach end of file in c sharp (c#)</strong></p>
<p>StreamReader sr = File.OpenText(textBox1.Text);</p>
<p>Boolean status = true;</p>
<p>while (status)</p>
<p>{</p>
<p>string line = sr.ReadLine();</p>
<p>&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8212;&#8211;</p>
<p>&#8212;-ur code&#8212;&#8212;&#8212;&#8212;</p>
<p>if (sr.EndOfStream)</p>
<p>status = false;</p>
<p>}</p>
<p><strong> </strong></p>
<p><strong>7.Check String contains in C sharp (c#)</strong></p>
<p>string str = “hai welcome to india”</p>
<p>if (str.Contains(“to”))</p>
<p>MessageBox.Show(&#8220;The given sub string presents&#8221;);</p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://ivreddy.com/c-sharp-questions-and-answers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>FlightReservation Examples2 using qtp</title>
		<link>http://ivreddy.com/flightreservation-examples2-using-qtp/</link>
		<comments>http://ivreddy.com/flightreservation-examples2-using-qtp/#comments</comments>
		<pubDate>Thu, 16 Sep 2010 08:50:46 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[QTP]]></category>

		<guid isPermaLink="false">http://ivreddy.com/?p=1928</guid>
		<description><![CDATA[<p>1.Record the log in fail operation ,modifiy the script and execute (Check whether the error pop up is coming or not) </p>
<p>SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;,&#8221;",&#8221;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\&#8221;,&#8221;open&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set DataTable(&#8220;FailCases&#8221;, dtGlobalSheet)</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c91bc221cac82356789274ebd5c0e68ab84531d&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>obj1=Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).Exist</p>
<p>If obj1 Then</p>
<p>reporter.ReportEvent micPass,&#8221;should pass&#8221;,&#8221;done&#8221;</p>
<p>else</p>
<p>reporter.ReportEvent micFail,&#8221;fail&#8221;,&#8221;not expected&#8221;</p>
<p>End If</p>
<p>Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;Cancel&#8221;).Click</p>
<p>2.Record for incorrect password.Add the objects of incorrect password window to Object Repository.Modify the script <span style="color:#777"> . . . &#8594; Read More: <a href="http://ivreddy.com/flightreservation-examples2-using-qtp/">FlightReservation Examples2 using qtp</a></span>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;">1.Record the log in fail operation ,modifiy the script and execute (Check whether the error pop up is coming or not) </span></p>
<p>SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;,&#8221;",&#8221;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\&#8221;,&#8221;open&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set DataTable(&#8220;FailCases&#8221;, dtGlobalSheet)</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c91bc221cac82356789274ebd5c0e68ab84531d&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p><span style="color: #008000;">obj1=Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).Exist</span></p>
<p>If obj1 Then</p>
<p>reporter.ReportEvent micPass,&#8221;should pass&#8221;,&#8221;done&#8221;</p>
<p>else</p>
<p>reporter.ReportEvent micFail,&#8221;fail&#8221;,&#8221;not expected&#8221;</p>
<p>End If</p>
<p>Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;Cancel&#8221;).Click</p>
<p><span style="color: #ff0000;">2.Record for incorrect password.Add the objects of incorrect password window to Object Repository.Modify the script and execute.(Get the message from the pop up and check)</span></p>
<p>SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;,&#8221;",&#8221;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\&#8221;,&#8221;open&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).Set  &#8220;incorrect&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p><span style="color: #008000;">msg=dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).Static(&#8220;Incorrect password. Please&#8221;).GetROProperty(&#8220;text&#8221;)</span></p>
<p>If msg=&#8221;Incorrect password. Please try again&#8221; Then</p>
<p>reporter.ReportEvent micPass,&#8221;This is Pass&#8221;,&#8221;ok na&#8221;</p>
<p>End If</p>
<p>Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;Cancel&#8221;).Click</p>
<p><span style="color: #ff0000;">3.Open the booked orders and send fax orders. (Used Regular Expressions and Parameterization).</span></p>
<p>a.Record for login and open an order &amp; send fax order</p>
<p>b.Do parameterization at order number</p>
<p>c.Use Regular Expression at (Ex:Dialog(&#8220;Fax Order No. 2&#8243;))</p>
<p>SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;,&#8221;",&#8221;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\&#8221;,&#8221;open&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c91c4b3fe65cca29a1c1c0820bfdeea176fb3c4&#8243;</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinMenu(&#8220;Menu&#8221;).Select &#8220;File;Open Order&#8230;&#8221;</p>
<p>Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinCheckBox(&#8220;Order No.&#8221;).Set &#8220;ON&#8221;</p>
<p>Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinEdit(&#8220;Edit&#8221;).Set DataTable(&#8220;order&#8221;, dtGlobalSheet)</p>
<p>Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Open Order&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinMenu(&#8220;Menu&#8221;).Select &#8220;File;Fax Order&#8230;&#8221;</p>
<p>Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Fax Order No. 2&#8243;).ActiveX(&#8220;MaskEdBox&#8221;).Type &#8220;1323232323&#8243;</p>
<p>Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Fax Order No. 2&#8243;).WinButton(&#8220;Send&#8221;).Click</p>
<p>Window(&#8220;Flight Reservation&#8221;).Close</p>
<p><span style="color: #ff0000;">4.Check how many Buttons and Radio buttons are there</span></p>
<p>SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;,&#8221;",&#8221;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\&#8221;,&#8221;open&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c90a563f23d7e76c5337820c246323ce7bb8ffe&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Set obj1=description.Create()</p>
<p>obj1(&#8220;micclass&#8221;).value=&#8221;winbutton&#8221;</p>
<p><span style="color: #008000;">Set buttons=window(&#8220;Flight Reservation&#8221;).ChildObjects(obj1)</span></p>
<p><span style="color: #008000;">no_buttons=buttons.count()</span></p>
<p>msgbox &#8220;The number of buttons are :  &#8221; &amp;no_buttons</p>
<p>Set obj2=description.Create()</p>
<p>obj2(&#8220;micclass&#8221;).value=&#8221;WinRadioButton&#8221;</p>
<p><span style="color: #008000;">Set radio=window(&#8220;Flight Reservation&#8221;).ChildObjects(obj2)</span></p>
<p><span style="color: #008000;">no_rb=radio.count()</span></p>
<p>msgbox &#8220;The number of radio buttons are &#8221; &amp;no_rb</p>
<p>Window(&#8220;Flight Reservation&#8221;).Close</p>
]]></content:encoded>
			<wfw:commentRss>http://ivreddy.com/flightreservation-examples2-using-qtp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Flight Reservation Application Testing Examples using QTP (Quick Test Professional)</title>
		<link>http://ivreddy.com/flight-reservation-application-testing-examples-using-qtp-quick-test-professional/</link>
		<comments>http://ivreddy.com/flight-reservation-application-testing-examples-using-qtp-quick-test-professional/#comments</comments>
		<pubDate>Fri, 20 Aug 2010 05:23:50 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[QTP]]></category>

		<guid isPermaLink="false">http://ivreddy.com/?p=1883</guid>
		<description><![CDATA[<p>1. Record and PlayBack</p>
<p>(Login to Flight Reservation ,Book one ticket ,Insert Order , Send Fax Order and close)</p>
<p>systemutil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).Activate</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Type  micTab</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c639147ce17debfa9a680adf3fb0a1f7b766d39&#8243;</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Window(&#8220;Flight Reservation&#8221;).ActiveX(&#8220;MaskEdBox&#8221;).Type &#8220;081310&#8243;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinComboBox(&#8220;Fly From:&#8221;).Select &#8220;Frankfurt&#8221;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinComboBox(&#8220;Fly To:&#8221;).Select &#8220;London&#8221;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinEdit(&#8220;Name:&#8221;).Set &#8220;venkat&#8221;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinButton(&#8220;FLIGHT&#8221;).Click</p>
<p>Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Flights Table&#8221;).WinList(&#8220;From&#8221;).Activate &#8220;13536   FRA   08:00 AM   LON   08:45 AM   SR     $163.00&#8243;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinEdit(&#8220;Name:&#8221;).Set &#8220;venkat&#8221;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinButton(&#8220;Insert Order&#8221;).Click</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinMenu(&#8220;Menu&#8221;).Select &#8220;File;Fax Order&#8230;&#8221;</p>
<p>&#8216; <span style="color:#777"> . . . &#8594; Read More: <a href="http://ivreddy.com/flight-reservation-application-testing-examples-using-qtp-quick-test-professional/">Flight Reservation Application Testing Examples using QTP (Quick Test Professional)</a></span>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>1. Record and PlayBack</strong></span></p>
<p><strong>(Login to Flight Reservation ,Book one ticket ,Insert Order , Send Fax Order and close)</strong></p>
<p>systemutil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).Activate</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Type  micTab</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c639147ce17debfa9a680adf3fb0a1f7b766d39&#8243;</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Window(&#8220;Flight Reservation&#8221;).ActiveX(&#8220;MaskEdBox&#8221;).Type &#8220;081310&#8243;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinComboBox(&#8220;Fly From:&#8221;).Select &#8220;Frankfurt&#8221;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinComboBox(&#8220;Fly To:&#8221;).Select &#8220;London&#8221;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinEdit(&#8220;Name:&#8221;).Set &#8220;venkat&#8221;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinButton(&#8220;FLIGHT&#8221;).Click</p>
<p>Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Flights Table&#8221;).WinList(&#8220;From&#8221;).Activate &#8220;13536   FRA   08:00 AM   LON   08:45 AM   SR     $163.00&#8243;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinEdit(&#8220;Name:&#8221;).Set &#8220;venkat&#8221;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinButton(&#8220;Insert Order&#8221;).Click</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinMenu(&#8220;Menu&#8221;).Select &#8220;File;Fax Order&#8230;&#8221;</p>
<p>&#8216; used regular expression at the below Fax Order.Rht Click  on  Dialog and make it  Fax Order No.*  .And  check the regular expression</p>
<p>Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Fax Order No. 12&#8243;).ActiveX(&#8220;MaskEdBox&#8221;).Type &#8220;0809972129&#8243;</p>
<p>Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Fax Order No. 12&#8243;).WinCheckBox(&#8220;Send Signature with order&#8221;).Set &#8220;ON&#8221;</p>
<p>Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Fax Order No. 12&#8243;).WinButton(&#8220;Send&#8221;).Click</p>
<p>Window(&#8220;Flight Reservation&#8221;).Close</p>
<p><span style="color: #ff0000;"><strong>2 Descriptive Programming  (Login to Flight Reservation)</strong></span></p>
<p>systemutil.run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>Dialog(&#8220;text:=Login&#8221;).WinEdit(&#8220;attached text:=Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>Dialog(&#8220;text:=Login&#8221;).WinEdit(&#8220;attached text:=Password:&#8221;).SetSecure &#8220;4c63941e33c84ad39b70103970c7fe0f8e429f0f&#8221;</p>
<p>Dialog(&#8220;text:=Login&#8221;).WinButton(&#8220;text:=OK&#8221;).Click</p>
<p>Window(&#8220;text:=Flight Reservation&#8221;).Close</p>
<p><span style="color: #ff0000;"><strong>3.Capture Screen Shot (using CaptureBitmap)—</strong></span></p>
<p><strong>Login failed at Flight Reservation Application</strong></p>
<p>SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>&#8216;Desktop.CaptureBitmap &#8220;d:\login4.png&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c0616cda83a5c9f88633cdaff4c044c&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).CaptureBitmap &#8220;d:\login.bmp&#8221;</p>
<p>bexists=Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).Exist(2)</p>
<p>If bexists Then</p>
<p>smsg=Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).GetVisibleText</p>
<p>reporter.ReportEvent micFail,&#8221;Login&#8221;,smsg</p>
<p>Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;Cancel&#8221;).Click</p>
<p>exittest</p>
<p>End If</p>
<p><span style="color: #ff0000;"><strong>4. Reusable Action  (Flight Reservation Example)</strong></span></p>
<p><strong>Action1: (Login with incorrect password and cacel)</strong></p>
<p>SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;,&#8221;",&#8221;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\&#8221;,&#8221;open&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c0616cda83a5c9f88633cdaff4c044c&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>bexists=Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).Exist(2)</p>
<p>If bexists Then</p>
<p>smsg=Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).GetVisibleText</p>
<p>reporter.ReportEvent micFail,&#8221;Login&#8221;,smsg</p>
<p>Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;Cancel&#8221;).Click</p>
<p>End If</p>
<p>runaction &#8220;Action3&#8243;,oneiteration</p>
<p><strong>Action2:</strong></p>
<p>msgbox &#8220;welcome to action2&#8243;</p>
<p><strong>Action3: (Reusable Action) used in Action1 : (Login with correct password)</strong></p>
<p>SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;,&#8221;",&#8221;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\&#8221;,&#8221;open&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c06513879e8c9aae96f878ebd40924cb403de52&#8243;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).Type  micReturn</p>
<p>Window(&#8220;Flight Reservation&#8221;).Close</p>
<p><span style="color: #ff0000;"><strong>5. Regular Expression and Parameterization </strong></span></p>
<p><strong>(Login to Flight Reservation application, insert order and send fax information)</strong></p>
<p><strong>(need to create fax_no in global sheet with fax numbers)</strong></p>
<p>&#8216; Use of Regular Expressions and  Parameterization</p>
<p>&#8216; Insert Order and Send Fax</p>
<p>systemutil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).Activate</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c63b0b0656069024c0d34dd2f5745a7b3780b8a&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Window(&#8220;Flight Reservation&#8221;).ActiveX(&#8220;MaskEdBox&#8221;).Type &#8220;081410&#8243;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinComboBox(&#8220;Fly From:&#8221;).Select &#8220;London&#8221;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinComboBox(&#8220;Fly To:&#8221;).Select &#8220;Los Angeles&#8221;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinButton(&#8220;FLIGHT&#8221;).Click</p>
<p>Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Flights Table&#8221;).WinList(&#8220;From&#8221;).Activate &#8220;19138   LON   08:00 AM   LAX   08:45 AM   AA     $102.00&#8243;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinEdit(&#8220;Name:&#8221;).Set &#8220;venky&#8221;</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinButton(&#8220;Insert Order&#8221;).Click</p>
<p>Window(&#8220;Flight Reservation&#8221;).WinMenu(&#8220;Menu&#8221;).Select &#8220;File;Fax Order&#8230;&#8221;</p>
<p>&#8216; Rht click on the dialog  below and make .*  and check the regular expression</p>
<p>Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Fax Order No. 21&#8243;).ActiveX(&#8220;MaskEdBox&#8221;).Type DataTable(&#8220;fax_no&#8221;, dtGlobalSheet)</p>
<p>Window(&#8220;Flight Reservation&#8221;).Dialog(&#8220;Fax Order No. 21&#8243;).WinButton(&#8220;Send&#8221;).Click</p>
<p>Window(&#8220;Flight Reservation&#8221;).Close</p>
<p><span style="color: #ff0000;"><strong>6.Shared Object Repository</strong></span></p>
<p>a.(Record Login to Flight Reservation. Goto&#8211;Resouces&#8211;Object Repository(File&#8211;Export Local Objects).It will save as .tsr file)</p>
<p>systemuti.run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c63bd987f7ea31db67d4ec3760e762a901d3161&#8243;</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Window(&#8220;Flight Reservation&#8221;).Close</p>
<p>How to use it :</p>
<p>Goto&#8211;Resources&#8211;Associate Repositories&#8211;Browse the .tsr file and add it.We can&#8217;t edit this shared O.R.</p>
<p>b. Goto&#8211;Resources&#8211;Object Repository Manager&#8211;(Objects&#8211;Add Objects).File&#8211;Save As.It will save as .tsr file</p>
<p><span style="color: #ff0000;"><strong>7. How to use Library Functions </strong></span></p>
<p><strong>a. addition.vbs</strong></p>
<p>Function add</p>
<p>a=20</p>
<p>b=30</p>
<p>c=a+b</p>
<p>msgbox &#8220;The addition of a and b is : &#8220;&amp;c</p>
<p>End Function</p>
<p><strong>b. multiplication.vbs</strong></p>
<p>Function mul</p>
<p>a=4</p>
<p>b=5</p>
<p>c=a*b</p>
<p>msgbox &#8220;The multiplication of a and b is :&#8221;&amp;c</p>
<p>end function</p>
<p>(File&#8211;Settings&#8211;Resources&#8211;Browse files)</p>
<p><span style="color: #ff0000;"><strong>8.Give different keywords at google and search (used descriptive programming and parameterization)</strong></span></p>
<p>Set ie=createobject(&#8220;internetexplorer.application&#8221;)</p>
<p>ie.navigate(&#8220;http://www.google.co.in/&#8221;)</p>
<p>ie.visible=true</p>
<p>Browser(&#8220;title:=Google&#8221;).Page(&#8220;title:=Google&#8221;).WebEdit(&#8220;name:=q&#8221;).Set DataTable(&#8220;search_keywords&#8221;,dtGlobalSheet)</p>
<p>Browser(&#8220;title:=Google&#8221;).Page(&#8220;title:=Google&#8221;).WebButton(&#8220;value:=Google Search&#8221;).Click</p>
<p>Browser(&#8220;opentitle:=Google&#8221;).Close</p>
<p><span style="color: #ff0000;"><strong>9.Store Results in Excel</strong></span></p>
<p><strong> </strong></p>
<p>Set  xl= CreateObject(&#8220;Excel.application&#8221;)</p>
<p>set wb=xl.workbooks.open(&#8220;d:/sample2.xls&#8221;)</p>
<p>Set ws=wb.worksheets(1)</p>
<p>a=15</p>
<p>b=20</p>
<p>If a&gt;b  Then</p>
<p>ws.Cells(1,1).Value =&#8221;a is bigger&#8221;</p>
<p>ws.Cells(1,2).value=&#8221;PASS&#8221;</p>
<p>Reporter.ReportEvent micDone,&#8221;a is bigger&#8221;, a</p>
<p>Else</p>
<p>ws.Cells(1,1).Value = &#8220;b is bigger&#8221;</p>
<p>ws.Cells(1,2).value = &#8220;FAIL&#8221;</p>
<p>ws.cells(1,2).font.bold=true</p>
<p>ws.cells(1,2).font.size=12</p>
<p>ws.Cells(1,2).font.colorindex=50</p>
<p>Reporter.ReportEvent  micFail ,&#8221;b is bigger&#8221; , b</p>
<p>End If</p>
<p>wb.save</p>
<p>wb.close</p>
<p>Set ws=nothing</p>
<p>Set wb=nothing</p>
<p>Set xl=nothing</p>
<p><strong> </strong></p>
<p><strong> </strong></p>
<p><strong> </strong></p>
]]></content:encoded>
			<wfw:commentRss>http://ivreddy.com/flight-reservation-application-testing-examples-using-qtp-quick-test-professional/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Flight Reservation examples using qtp-part1</title>
		<link>http://ivreddy.com/flight-reservation-examples-using-qtp-part1/</link>
		<comments>http://ivreddy.com/flight-reservation-examples-using-qtp-part1/#comments</comments>
		<pubDate>Wed, 11 Aug 2010 12:53:04 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[QTP]]></category>

		<guid isPermaLink="false">http://ivreddy.com/?p=1880</guid>
		<description><![CDATA[<p>Check whether error pop up exists or not .If exists then capture that popup and click ok on that error popup</p>
<p>SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c0616cda83a5c9f88633cdaff4c044c&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).CaptureBitmap &#8220;d:\login.bmp&#8221;</p>
<p>bexists=Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).Exist(2)</p>
<p>If bexists Then</p>
<p>smsg=Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).GetVisibleText</p>
<p>reporter.ReportEvent micFail,&#8221;Login&#8221;,smsg</p>
<p>Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;Cancel&#8221;).Click</p>
<p>exittest</p>
<p>End If</p>
<p>Run Reusable and Non reusable actions in qtp</p>
<p> </p>
<p>Action1:</p>
<p>SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;,&#8221;",&#8221;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\&#8221;,&#8221;open&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c0616cda83a5c9f88633cdaff4c044c&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>bexists=Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).Exist(2)</p>
<p>If <span style="color:#777"> . . . &#8594; Read More: <a href="http://ivreddy.com/flight-reservation-examples-using-qtp-part1/">Flight Reservation examples using qtp-part1</a></span>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>Check whether error pop up exists or not .If exists then capture that popup and click ok on that error popup</strong></span></p>
<p>SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c0616cda83a5c9f88633cdaff4c044c&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).CaptureBitmap &#8220;d:\login.bmp&#8221;</p>
<p>bexists=Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).Exist(2)</p>
<p>If bexists Then</p>
<p>smsg=Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).GetVisibleText</p>
<p>reporter.ReportEvent micFail,&#8221;Login&#8221;,smsg</p>
<p>Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;Cancel&#8221;).Click</p>
<p>exittest</p>
<p>End If</p>
<p><span style="color: #ff0000;"><strong>Run Reusable and Non reusable actions in qtp</strong></span></p>
<p><strong> </strong></p>
<p><strong>Action1:</strong></p>
<p>SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;,&#8221;",&#8221;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\&#8221;,&#8221;open&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c0616cda83a5c9f88633cdaff4c044c&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>bexists=Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).Exist(2)</p>
<p>If bexists Then</p>
<p>smsg=Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).GetVisibleText</p>
<p>reporter.ReportEvent micFail,&#8221;Login&#8221;,smsg</p>
<p>Dialog(&#8220;Login&#8221;).Dialog(&#8220;Flight Reservations&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p>Dialog(&#8220;Login&#8221;).WinButton(&#8220;Cancel&#8221;).Click</p>
<p>End If</p>
<p>runaction &#8220;Action3&#8243;,oneiteration</p>
<p><strong>Action2</strong></p>
<p>msgbox &#8220;welcome to action2&#8243;</p>
<p><strong>Reusable Action3</strong></p>
<p>SystemUtil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;,&#8221;",&#8221;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\&#8221;,&#8221;open&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).SetSecure &#8220;4c06513879e8c9aae96f878ebd40924cb403de52&#8243;</p>
<p>Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).Type  micReturn</p>
<p>Window(&#8220;Flight Reservation&#8221;).Close</p>
<p><span style="color: #ff0000;"><strong>1.How to give inputs from the global sheet—</strong></span></p>
<p><span style="color: #ff0000;"><strong>This example is under descriptive programming</strong></span></p>
<p><span style="color: #ff0000;"><strong>2.Give different search keywords at google and search using qtp</strong></span></p>
<p>Set ie=createobject(&#8220;internetexplorer.application&#8221;)</p>
<p>ie.navigate(&#8220;http://www.google.co.in/&#8221;)</p>
<p>ie.visible=true</p>
<p>Browser(&#8220;title:=Google&#8221;).Page(&#8220;title:=Google&#8221;).WebEdit(&#8220;name:=q&#8221;).Set DataTable(&#8220;search_keywords&#8221;,dtGlobalSheet)</p>
<p>Browser(&#8220;title:=Google&#8221;).Page(&#8220;title:=Google&#8221;).WebButton(&#8220;value:=Google Search&#8221;).Click</p>
<p>Browser(&#8220;opentitle:=Google&#8221;).Close</p>
<p><span style="color: #ff0000;"><strong>How to import/export excel from global sheet in qtp</strong></span></p>
<p>Goto Global Sheet..Right Click—File&#8211;Import/Export</p>
<p><strong>Create an excel and put results into the excel using qtp</strong></p>
<p>Set  xl= CreateObject(&#8220;Excel.application&#8221;)</p>
<p>xl.Visible = True</p>
<p>xl.Workbooks.add</p>
<p>a=15</p>
<p>b=20</p>
<p>If a&gt;b  Then</p>
<p>xl.Cells(1,1).Value = a</p>
<p>xl.Cells(1,2).value=&#8221;PASS&#8221;</p>
<p>Reporter.ReportEvent micDone,&#8221;a is bigger&#8221;, a</p>
<p>Else</p>
<p>xl.Cells(1,1).Value = b</p>
<p>xl.Cells(1,2).value=&#8221;FAIL&#8221;</p>
<p>Reporter.ReportEvent  micFail ,&#8221;b is bigger&#8221; , b</p>
<p>End If</p>
<p><strong>Open excel and put results in the excel</strong></p>
<p>Set  xl= CreateObject(&#8220;Excel.application&#8221;)</p>
<p>set wb=xl.workbooks.open(&#8220;d:/sample2.xls&#8221;)</p>
<p>Set ws=wb.worksheets(1)</p>
<p>&#8216;xl.Visible = True</p>
<p>&#8216;xl.Workbooks.add</p>
<p>a=15</p>
<p>b=20</p>
<p>If a&gt;b  Then</p>
<p>ws.Cells(1,1).Value =&#8221;a is bigger&#8221;</p>
<p>ws.Cells(1,2).value=&#8221;PASS&#8221;</p>
<p>Reporter.ReportEvent micDone,&#8221;a is bigger&#8221;, a</p>
<p>Else</p>
<p>ws.Cells(1,1).Value = &#8220;b is bigger&#8221;</p>
<p>ws.Cells(1,2).value = &#8220;FAIL&#8221;</p>
<p>ws.cells(1,2).font.bold=true</p>
<p>ws.cells(1,2).font.size=12</p>
<p>ws.Cells(1,2).font.colorindex=50</p>
<p>Reporter.ReportEvent  micFail ,&#8221;b is bigger&#8221; , b</p>
<p>End If</p>
<p>wb.save</p>
<p>wb.close</p>
<p>Set ws=nothing</p>
<p>Set wb=nothing</p>
<p>Set xl=nothing</p>
]]></content:encoded>
			<wfw:commentRss>http://ivreddy.com/flight-reservation-examples-using-qtp-part1/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Descriptive Programming in qtp with example</title>
		<link>http://ivreddy.com/descriptive-programming-in-qtp-with-example/</link>
		<comments>http://ivreddy.com/descriptive-programming-in-qtp-with-example/#comments</comments>
		<pubDate>Tue, 10 Aug 2010 09:14:56 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[QTP]]></category>

		<guid isPermaLink="false">http://ivreddy.com/?p=1874</guid>
		<description><![CDATA[<p>Descriptive Programming :
1.If we use Object Repository,then while executing any test,
qtp feteches the properties and values from the object repository
and it will execute
2.If we use descriptive programming,then we need to give properties
and values of objects in the test.So while executing the test, based
on them it will execute</p>
<p>To determine properties and values ,we can use object spy
goto <span style="color:#777"> . . . &#8594; Read More: <a href="http://ivreddy.com/descriptive-programming-in-qtp-with-example/">Descriptive Programming in qtp with example</a></span>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>Descriptive Programming :</strong></span><br />
1.If we use Object Repository,then while executing any test,<br />
qtp feteches the properties and values from the object repository<br />
and it will execute<br />
2.If we use descriptive programming,then we need to give properties<br />
and values of objects in the test.So while executing the test, based<br />
on them it will execute</p>
<p>To determine properties and values ,we can use object spy<br />
goto Tools&#8211;Object Spy<br />
Click on the hand button,then click on the object which u want to<br />
spy</p>
<p><strong><br />
<span style="color: #ff0000;">Flight Reservation Log in Example using Descriptive Programming </span></strong></p>
<p>Systemutil.Run &#8220;C:\Program Files\Mercury Interactive\QuickTest Professional\samples\flight\app\flight4a.exe&#8221;<br />
Dialog(&#8220;text:=Login&#8221;).WinEdit(&#8220;attached text:=Agent Name:&#8221;).Set &#8220;venkatesh&#8221;<br />
Dialog(&#8220;text:=Login&#8221;).WinEdit(&#8220;attached text:=Password:&#8221;,&#8221;enabled:=True&#8221;).SetSecure &#8220;mercury&#8221;<br />
Dialog(&#8220;text:=Login&#8221;).WinButton(&#8220;text:=OK&#8221;).Click<br />
Window(&#8220;text:=Flight Reservation&#8221;).Close</p>
]]></content:encoded>
			<wfw:commentRss>http://ivreddy.com/descriptive-programming-in-qtp-with-example/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>How to create Function Library using QTP</title>
		<link>http://ivreddy.com/how-to-create-function-library-using-qtp/</link>
		<comments>http://ivreddy.com/how-to-create-function-library-using-qtp/#comments</comments>
		<pubDate>Sun, 08 Aug 2010 16:26:09 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[QTP]]></category>

		<guid isPermaLink="false">http://ivreddy.com/?p=1870</guid>
		<description><![CDATA[<p>Create Function Library in qtp</p>
<p>Create one vbs file like addition.vbs</p>
<p>Function addition
a=20
b=30
c=a+b
msgbox c
end Function</p>
<p>Create another vbs file like multiple.vbs</p>
<p>Function mul
a=5
b=6
c=a*b
msgbox c
end Function</p>
<p>To add the above vb script files goto File&#8211;Settings&#8211;Resources&#8211;there browse the above saved files and do ok</p>
<p>Now create one new test using qtp and write script like function calls</p>
<p>addition
mul</p>
<p>Run it.It <span style="color:#777"> . . . &#8594; Read More: <a href="http://ivreddy.com/how-to-create-function-library-using-qtp/">How to create Function Library using QTP</a></span>]]></description>
			<content:encoded><![CDATA[<p>Create Function Library in qtp</p>
<p><span style="color: #ff0000;">Create one vbs file like addition.vbs</span></p>
<p>Function addition<br />
a=20<br />
b=30<br />
c=a+b<br />
msgbox c<br />
end Function</p>
<p><span style="color: #ff0000;">Create another vbs file like multiple.vbs</span></p>
<p>Function mul<br />
a=5<br />
b=6<br />
c=a*b<br />
msgbox c<br />
end Function</p>
<p>To add the above vb script files goto <span style="color: #ff0000;">File&#8211;Settings&#8211;Resources</span>&#8211;there browse the above saved files and do ok</p>
<p>Now create one new test using qtp and write script like function calls</p>
<p>addition<br />
mul</p>
<p>Run it.It will execute</p>
]]></content:encoded>
			<wfw:commentRss>http://ivreddy.com/how-to-create-function-library-using-qtp/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>vbscript interview questions and answers</title>
		<link>http://ivreddy.com/vbscript-interview-questions-and-answers/</link>
		<comments>http://ivreddy.com/vbscript-interview-questions-and-answers/#comments</comments>
		<pubDate>Thu, 24 Jun 2010 12:54:15 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[vb script]]></category>
		<category><![CDATA[vbscript]]></category>

		<guid isPermaLink="false">http://ivreddy.com/?p=1854</guid>
		<description><![CDATA[<p>&#8216; 1.how to open browser in vb script
set ie=createobject(&#8220;internetexplorer.application&#8221;)
ie.navigate(&#8220;http://www.google.co.in/&#8221;)
ie.visible=true
set ie = nothing</p>
<p>&#8216; 2.Why to use option explicit in vb script
&#8216;If we declare variables with some values and while using if we use (spell mistake) then user can&#8217;t know
&#8216; putting option explicit is useful there
&#8216; Example starts here
option explicit
dim abcd
abcd=20
msgbox abcd
dim bcde
bcde=30
msgbox bcdef</p>
<p>&#8217;3.how to open a file <span style="color:#777"> . . . &#8594; Read More: <a href="http://ivreddy.com/vbscript-interview-questions-and-answers/">vbscript interview questions and answers</a></span>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;">&#8216; 1.how to open browser in vb script</span><br />
set ie=createobject(&#8220;internetexplorer.application&#8221;)<br />
ie.navigate(&#8220;http://www.google.co.in/&#8221;)<br />
ie.visible=true<br />
set ie = nothing</p>
<p><span style="color: #ff0000;">&#8216; 2.Why to use option explicit in vb script</span><br />
&#8216;If we declare variables with some values and while using if we use (spell mistake) then user can&#8217;t know<br />
&#8216; putting option explicit is useful there<br />
&#8216; Example starts here<br />
option explicit<br />
dim abcd<br />
abcd=20<br />
msgbox abcd<br />
dim bcde<br />
bcde=30<br />
msgbox bcdef</p>
<p><span style="color: #ff0000;">&#8217;3.how to open a file .What is the perpose of true and false mode there</span><br />
&#8216;How to read from file and write into the file</p>
<p>set files = createobject(&#8220;scripting.filesystemobject&#8221;)<br />
set obj1=files.opentextfile(&#8220;d:\file2.txt&#8221;,2,true)   &#8216; true uses for ceating txt file<br />
set obj2=files.opentextfile(&#8220;d:\file2.txt&#8221;,1,false)  &#8216; false will not create any file<br />
obj1.writeline(&#8220;write this line into file&#8221;)<br />
str=obj2.readline<br />
msgbox str<br />
set files=nothing</p>
<p><span style="color: #ff0000;">&#8217;4.if else for do while select  in vb script</span></p>
<p>i=5<br />
j=6<br />
if i&gt;j then<br />
msgbox i<br />
elseif i&lt;j then<br />
msgbox j<br />
else<br />
msgbox &#8220;nothing&#8221;<br />
end if</p>
<p>for i=5 to 10 step 2<br />
msgbox i<br />
next</p>
<p>do while i&lt;15<br />
msgbox i<br />
i=i+3<br />
loop</p>
<p>mycase=&#8221;gitam&#8221;<br />
select case mycase<br />
case &#8220;abcd&#8221;<br />
msgbox  &#8220;abcd&#8221;<br />
case mycase<br />
msgbox mycase<br />
case else<br />
msgbox &#8220;wrong&#8221;<br />
end select</p>
<p><span style="color: #ff0000;">&#8217;5.how to write functions and sub in vb script</span></p>
<p>function add(a,b)<br />
sum=a+b<br />
add=sum<br />
end function</p>
<p>s=add(6,8)<br />
msgbox s</p>
<p>sub add2(x,y)<br />
sum=x+y<br />
msgbox sum<br />
end sub</p>
<p>call add2(6,8)</p>
<p><span style="color: #ff0000;">&#8217;6 what is variant in vb script</span><br />
variant is the only datatype in vb script.There are many subtypes under variant.<br />
They are Empty,Null,Boolean,Byte,Integer,Currency,Long,Single,Double,Date ,String,Object,Error</p>
<p><span style="color: #ff0000;">&#8216; 7 .how to open excel in vb script</span><br />
set xl=createobject(&#8220;excel.application&#8221;)<br />
set wb=xl.workbooks.open(&#8220;d:/sample.xls&#8221;)<br />
set ws=wb.worksheets(1)<br />
ws.cells(3,4)=&#8221;welcome&#8221;<br />
wb.save<br />
wb.close<br />
set wb=nothing<br />
set ws=nothing<br />
set xl=nothing</p>
<p><span style="color: #ff0000;">&#8216; 8.difference between dim,public and private variables in vb script</span><br />
&#8216; Use of dim ,private and public variables in vb script</p>
<p>function first<br />
dim a<br />
a=20<br />
msgbox a      &#8216; 20 displays<br />
end function</p>
<p>first</p>
<p>msgbox a   &#8216; this gives empty value</p>
<p>&#8216; so dim variables are not public if we use within function<br />
dim b<br />
b=30<br />
function second<br />
msgbox b                 &#8216; 30 displays<br />
end function<br />
second</p>
<p>&#8216; if we declare dim variables outside the function then it will act as public</p>
<p>class  myclas<br />
public c<br />
private d<br />
dim e<br />
sub mysub<br />
c=40<br />
d=50<br />
e=60<br />
msgbox &#8220;public : &#8220;&amp;c&amp;&#8221; private :&#8221;&amp;d&amp;&#8221;dim :&#8221;&amp;e<br />
end sub<br />
end class</p>
<p>set obj=new myclas<br />
obj.mysub<br />
msgbox obj.c<br />
&#8216;msgbox obj.d         &#8216;it won&#8217;t allow to display private variables<br />
msgbox obj.e</p>
]]></content:encoded>
			<wfw:commentRss>http://ivreddy.com/vbscript-interview-questions-and-answers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Object Repository Concepts in qtp with examples</title>
		<link>http://ivreddy.com/object-repository-concepts-in-qtp-with-examples/</link>
		<comments>http://ivreddy.com/object-repository-concepts-in-qtp-with-examples/#comments</comments>
		<pubDate>Sat, 19 Jun 2010 14:33:17 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[QTP]]></category>

		<guid isPermaLink="false">http://ivreddy.com/?p=1846</guid>
		<description><![CDATA[<p>Object Repository Concept in qtp :</p>
<p>Object Repository: It is a place where qtp stores the objects(Ex:buttons or Check Boxes) information.
There are two types of Object Repositories
1.Local Object Repository</p>
<p>By default if we record any test,that goes to Local Object Repository.
We can edit or delete object properties. Only that test can use that object repository.</p>
<p>2.Shared Object Repository
If we <span style="color:#777"> . . . &#8594; Read More: <a href="http://ivreddy.com/object-repository-concepts-in-qtp-with-examples/">Object Repository Concepts in qtp with examples</a></span>]]></description>
			<content:encoded><![CDATA[<p>Object Repository Concept in qtp :</p>
<p>Object Repository: It is a place where qtp stores the objects(Ex:buttons or Check Boxes) information.<br />
There are two types of Object Repositories<br />
<span style="color: #0000ff;">1.Local Object Repository</span></p>
<p>By default if we record any test,that goes to Local Object Repository.<br />
We can edit or delete object properties. Only that test can use that object repository.</p>
<p><span style="color: #0000ff;">2.Shared Object Repository</span><br />
If we create shared object repository,other tests can also<br />
use that shared object repository. We can&#8217;t edit object properties.<br />
To get more concepts on this.Go through below cases</p>
<p><span style="color: #ff0000;">1.How to create shared object repository</span><span style="color: #ff0000;"> in qtp</span><br />
Open Blank Test<br />
Goto  Resources&#8211;Object Repository Manager<br />
Object&#8212;Add Objects<br />
&#8211;&gt;Open ur application and add objects of the application<br />
save it anywhere in ur pc.<br />
the extension would be .tcr</p>
<p>Shared Object Repository Example :<br />
Open Blank Test<br />
Goto Resources&#8211;Object Repository Manager<br />
&#8211;&gt;open ur Flight Reservation Application<br />
object&#8211;Add objects<br />
&#8211;&gt;add objects of ur application<br />
1.add Agent Name edit box<br />
2.add Password edit box<br />
3.add ok button</p>
<p><span style="color: #ff0000;"><span style="color: #000000;">File&#8211;Save </span><br />
2.How to use shared object repository inqtp</span><br />
Goto   Resources&#8211;Associate Repositories<br />
One Associate Repositories window appears<br />
There click on + symbol to browse the shared object repository<br />
Goto Available actions,bydefault Action1 would be present<br />
click on action1 and then click on &gt; button<br />
It will add to Associated Actions<br />
Click ok.<br />
Now u can open local object repository and view the objetcs that<br />
u added through shared object repository.<br />
We can&#8217;t edit or delete those objects properties and values.</p>
<p>Now u can write ur testcase in expert view and execute</p>
<p>dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Set &#8220;venkatesh&#8221;<br />
dialog(&#8220;Login&#8221;).WinEdit(&#8220;Password:&#8221;).Set &#8220;mercury&#8221;<br />
dialog(&#8220;Login&#8221;).WinButton(&#8220;OK&#8221;).Click</p>
<p><span style="color: #ff0000;"><br />
3.How to export local object repository into shared object repository in qtp</span><br />
Open Blank Test<br />
Goto Resources&#8211;&gt;Object Repository<br />
Open ur Flight Reservation Application<br />
Goto Object&#8211;Add objects to Local<br />
Add ur application objects to ur test<br />
In the same object repository window<br />
Goto File&#8212;Export Local Objects. It saves as .tsr file<br />
So that  anyone can use that .tsr file.</p>
]]></content:encoded>
			<wfw:commentRss>http://ivreddy.com/object-repository-concepts-in-qtp-with-examples/feed/</wfw:commentRss>
		<slash:comments>9</slash:comments>
		</item>
		<item>
		<title>actiTIME web application examples in qtp</title>
		<link>http://ivreddy.com/actitime-web-application-examples-in-qtp/</link>
		<comments>http://ivreddy.com/actitime-web-application-examples-in-qtp/#comments</comments>
		<pubDate>Mon, 14 Jun 2010 17:22:24 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[QTP]]></category>

		<guid isPermaLink="false">http://ivreddy.com/?p=1834</guid>
		<description><![CDATA[<p>1.Check whether the button exists or not. If exists,check whether it is enabled or not.</p>
<p>If enabled,click on that button.</p>
<p>Install actiTIME1.5  into ur system. Add Login now button to the Object Repository.Then write the code in qtp
</p>
<p>Set mybutton=browser(&#8220;actiTIME &#8211; Login&#8221;).Page(&#8220;actiTIME &#8211; Login&#8221;).WebButton(&#8220;Login now&#8221;)
buttonclick mybutton            &#8216; function call</p>
<p>Function buttonclick(mybutton)
sstepname=&#8221;Button click&#8221;
sobjtype=mybutton.ToString    &#8216;  returns name and type of the object
msgbox <span style="color:#777"> . . . &#8594; Read More: <a href="http://ivreddy.com/actitime-web-application-examples-in-qtp/">actiTIME web application examples in qtp</a></span>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;">1.Check whether the button exists or not. If exists,check whether it is enabled or not.</span></p>
<p><span style="color: #ff0000;">If enabled,click on that button.</span></p>
<p><span style="color: #ff0000;"><span style="color: #0000ff;">Install actiTIME1.5  into ur system. Add Login now button to the Object Repository.Then write the code in qtp</span><br />
</span></p>
<p>Set mybutton=browser(&#8220;actiTIME &#8211; Login&#8221;).Page(&#8220;actiTIME &#8211; Login&#8221;).WebButton(&#8220;Login now&#8221;)<br />
buttonclick mybutton            <span style="color: #0000ff;">&#8216; function call</span></p>
<p>Function buttonclick(mybutton)<br />
sstepname=&#8221;Button click&#8221;<br />
sobjtype=mybutton.ToString    <span style="color: #0000ff;">&#8216;  returns name and type of the object</span><br />
msgbox sobjtype</p>
<p>bexists=mybutton.Exist(2)</p>
<p><span style="color: #0000ff;">&#8216; check whether the button exists or not</span><br />
If bexists Then<br />
smsg=sobjtype&amp;&#8221; is exists&#8221;<br />
reporter.ReportEvent micPass,sstepname,smsg<br />
else<br />
smsg=sobjtype&amp;&#8221;does not exists&#8221;<br />
reporter.ReportEvent micFail,sstepname,smsg<br />
exittest<br />
End If</p>
<p>bdisabled=mybutton.GetROProperty(&#8220;disabled&#8221;)</p>
<p><span style="color: #0000ff;">&#8216;Check whether the button is enabled or not</span><br />
If disabled=0 Then<br />
smsg=sobjtype&amp;&#8221; is enabled&#8221;<br />
reporter.ReportEvent micPass,sstepname,smsg<br />
else<br />
smsg=sobjtype&amp;&#8221; is disabled&#8221;<br />
reporter.ReportEvent micFail,sstepname,smsg<br />
exittest<br />
End If</p>
<p>&#8216; Click on the button</p>
<p>smsg=&#8221;Click on &#8220;&amp; sobjtype<br />
reporter.ReportEvent micPass,sstepname,smsg<br />
mybutton.Click</p>
<p>End Function</p>
<p><span style="color: #ff0000;">2.Check whether the edit box exists or not.If exists check whether it is enabled or not.</span></p>
<p><span style="color: #ff0000;">If enabled ,enter text into it. </span></p>
<p><span style="color: #ff0000;">In this example we are passing username,pwd and clicking Login button</span></p>
<p><span style="color: #0000ff;">Add username,pwd and login to the Object Repository.And write the code in qtp</span><br />
Function login(username,pwd)</p>
<p>Set editbox=browser(&#8220;actiTIME &#8211; Login&#8221;).Page(&#8220;actiTIME &#8211; Login&#8221;).WebEdit(&#8220;username&#8221;)<br />
msg=editbox.ToString<br />
If editbox.Exist Then<br />
msgbox  msg&amp;&#8221;  exists&#8221;<br />
If  editbox.GetROProperty(&#8220;disabled&#8221;)=0 Then<br />
msgbox msg&amp;&#8221; enabled&#8221;<br />
End If<br />
else<br />
Exittest<br />
End If</p>
<p>Set pwdbox=browser(&#8220;actiTIME &#8211; Login&#8221;).Page(&#8220;actiTIME &#8211; Login&#8221;).WebEdit(&#8220;pwd&#8221;)<br />
Set button=browser(&#8220;actiTIME &#8211; Login&#8221;).Page(&#8220;actiTIME &#8211; Login&#8221;).WebButton(&#8220;Login now&#8221;)<br />
editbox.Set username<br />
pwdbox.Set pwd<br />
button.Click</p>
<p>End Function<br />
Call login(&#8220;admin&#8221;,&#8221;manager&#8221;)</p>
]]></content:encoded>
			<wfw:commentRss>http://ivreddy.com/actitime-web-application-examples-in-qtp/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>CheckPoints in qtp</title>
		<link>http://ivreddy.com/checkpoints-in-qtp/</link>
		<comments>http://ivreddy.com/checkpoints-in-qtp/#comments</comments>
		<pubDate>Mon, 07 Jun 2010 12:28:40 +0000</pubDate>
		<dc:creator>admin</dc:creator>
				<category><![CDATA[QTP]]></category>

		<guid isPermaLink="false">http://ivreddy.com/?p=1830</guid>
		<description><![CDATA[<p>Check Points :
To check whether the expected value is matching with the actual value or not, we use check points in qtp</p>
<p>1.Standard CheckPoint :</p>
<p>Is used to Check the object property values</p>
<p>Example For Standard Check Point:Goto Flight Application
Enter agent name &#8220;venkatesh&#8221; and then record .
Goto&#8211;Insert&#8211;Check Point&#8211;Standard Checkpoint
Click on venkatesh.Then we have added the check point.Click on Cancel.</p>
<p>Exexute <span style="color:#777"> . . . &#8594; Read More: <a href="http://ivreddy.com/checkpoints-in-qtp/">CheckPoints in qtp</a></span>]]></description>
			<content:encoded><![CDATA[<p><span style="color: #ff0000;"><strong>Check Points :</strong></span><br />
<span style="color: #339966;">To check whether the expected value is matching with the actual value or not, we use check points</span> <span style="color: #339966;">in qtp</span></p>
<p>1.Standard CheckPoint :</p>
<p>Is used to Check the object property values</p>
<p>Example For Standard Check Point:Goto Flight Application<br />
Enter agent name &#8220;venkatesh&#8221; and then record .<br />
Goto&#8211;Insert&#8211;Check Point&#8211;Standard Checkpoint<br />
Click on venkatesh.Then we have added the check point.Click on Cancel.</p>
<p>Exexute it.<br />
Here we are checking the value in the Agent Name while running.</p>
<p>Dialog(&#8220;Login&#8221;).Activate<br />
Dialog(&#8220;Login&#8221;).WinEdit(&#8220;Agent Name:&#8221;).Check CheckPoint(&#8220;Agent Name:&#8221;)<br />
Dialog(&#8220;Login&#8221;).WinButton(&#8220;Cancel&#8221;).Click</p>
<p>We can use standard check points for checking<br />
Textboxes ,Radio Buttons,Drop down,Buttons,etc<br />
Also static (text,image),Window,etc</p>
]]></content:encoded>
			<wfw:commentRss>http://ivreddy.com/checkpoints-in-qtp/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

