Information

QTPPro

This is a group, where all the QTP Professionals can join and share there knowledge by posting the Queries or answering the queries.

Website: http://makeqtpeasy.blogspot.com
Members: 294
Latest Activity: Jun 7

Different Ways to click a button



Here i am giving an idea of how we can write the scripts in different ways..
Here i am taking an example in how many ways we can write a statement to click on a specified button.
I took two conditions first one is when we are using object repository, second one is when we are not using object repository
(Using Descriptive programming) .

Using Object Repository

'1st method
Window("Flight Reservation" ).WinButton( "Update Order").Click 'Common Method

'2nd method
Set wndObject=Window( "Flight Reservation" ) ' Assigning window object to an object variable
wndObject.WinButton ("Update Order").Click ' Following normal syntax ( click on a button)

' OR

Set btnObject=Window( "Flight Reservation" ).WinButton( "Update Order") ' Assigning Button object to an object variable
btnObject.Click ' Clicking on button using button object variable

'3rd method

With Window("Flight Reservation" ) ' Using With statement
.WinButton(" Update Order").click
End with


Using Descriptive Programming

'4th method

Window("text: =Flight Reservation" ).WinButton( "text:=&Update Order").Click ' Descriptive programming

'5th method

Set oDes=Description. Create ' creating a description object
oDes("nativeclass" ).value=" Button" ' assigning description to the description object
oDes("text") .value="&Update Order"
Window("text: =Flight Reservation" ).winbutton( oDes).click ' clicking on button using the created description object

'6th method

Set oDes=Description. Create ' creating a description object

set btnObjList=Window( "text:=Flight Reservation" ).ChildObjects( oDes) ' Flitering the objects
For objIndex=0 to btnObjList.count- 1
propVal=btnObjList( objIndex) .getroproperty( "text") ' Get property value from object
If propVal="&Update Order" Then ' Compare property value
btnObjList(objIndex ).click ' Click on identified object
Exit for ' Exit For loop after clicking on the button
End If
Next

'7th method

Public const wndFlight="text: =Flight Reservation" ' Assigning window object description to a constant
Public const btnUpdate="text: =&Update Order" ' Assigning Button object description to a constant

Window(wndFlight) .winbutton( btnUpdate) .click ' Click on a button using description constants


Discussion Forum

Unable to focus on Wpf Object

Started by Sushanth Dec 26, 2013.

QTP FREE DEMO

Started by QTP Help Feb 3, 2012.

Comment Wall

Comment

You need to be a member of QTPPro to add comments!

Comment by akshar jain on December 2, 2010 at 9:53am
Hi Partha,

I have got 9.2 dumps n I have fwd d same
Comment by P S Samal on December 2, 2010 at 2:54am
Hi Akshar,

Please forward me the QC and QTP dumps for 10.0.
mail id: samalpartha@gmail.com

Thanks in advance.

Partha
Comment by Shreyya on December 1, 2010 at 7:58pm
pls send me the dump / sample questions too !

shreyya.g@gmail.com
Comment by sharmi kumar on November 30, 2010 at 6:35pm
hi,
If anyone gets the dumps for QTP 10.0 please send that to me at ksharmi30@yahoo.com
Comment by Rengarajan Rajesh on November 30, 2010 at 10:49am
Hi Akshar,

Thanks! i got the dumps :):)
Comment by akshar jain on November 27, 2010 at 1:09pm
Hi Rajan,

I have forwarded the dumps..Kindly check n let me know if u need any further assistance
Comment by Rengarajan Rajesh on November 26, 2010 at 3:34pm
Hi Akshar Jain,
I joined Testrepublic on 11/26.Currently working in QTP v10.0 and have planned for certification(Dec).Rigorously preparing for the certification and looking for dumps also.
Can you please help me in providing dumbs and sample questions
Have collected/ing questions by googling.Need ur hepl
mailid : rengarajan.br@gmail.com
Thanks! in adv
- Rengarajan
Comment by akshar jain on November 17, 2010 at 5:27pm
Hi Ashwani I had sent the dumps to you.. Did u receive that...
Comment by Ashwani Sharma on November 10, 2010 at 11:57am
Please also send me the dumps.

My email address is ashwanisharma@gmail.com

Thanks in advance,
Ashwani
Comment by sharmi kumar on November 10, 2010 at 8:56am
ok fine.
 

Members (294)

 
 
 

© 2014   Created by Test Republic.

Badges  |  Report an Issue  |  Terms of Service