Test Republic

Community of Software Testing Professionals

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: 106
Latest Activity: 1 day ago

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

Venkataraman

QTP Support of Firefox 5 Replies

Started by Venkataraman. Last reply by Praveen kumar 1 day ago.

Punam

QTP + Flex how does this works ? 2 Replies

Started by Punam. Last reply by Sachin Dhall Feb 23.

Sanju

exporting QTP test results in excel sheet 4 Replies

Started by Sanju. Last reply by Sreenath Gopalakrishnan Feb 10.

Comment Wall

Comment

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

shaik fareed Comment by shaik fareed on March 8, 2010 at 11:12am
I am into manual testing and I just start learning it.So need some help on this.if any one can help me with material or with suggestions plz

MY ID :-shaik.fareed369@gmail.com
Vinayak Comment by Vinayak on February 26, 2010 at 1:00pm
Hi All.
i am preparing for QTP certification.If any info./maerial shair with me.

email id: vkuyate@gmail.com
Punam Comment by Punam on February 15, 2010 at 3:10pm
My Problem is QTP is not able to record/identify the Flash movie being played using Flash player, Do u have any solution for this....?

email id :- pu.musale@gamil.com
Punam Comment by Punam on February 15, 2010 at 3:08pm
Hi all,
Do any one know how does QTP 9.2 trail version works with flex application

I need to automate Flash objects (For ex: Discovery and National geograhic home Pages, there are flash movies playing). I have used IE 6 and IE 7 as well to automate flash.

My Problem is QTP is not able to record/identify the Flash movie being played using Flash player, Do u have any solution for this....?
Sheetal Singh Comment by Sheetal Singh on January 2, 2010 at 1:55am
Hi All,

I am into manual testing and I just start learning QTP.So need some help on this.

Thanks
Nilesh S. Patil Comment by Nilesh S. Patil on November 24, 2009 at 10:24am
Hi,
I have more than 2.5 years of experience in QTP. I would like to be with this group to get more knowledge.
Sushma Rao Comment by Sushma Rao on November 9, 2009 at 1:34pm
Hi All,

Opportunity for QA professionals
Location: Bangalore
Exp Level: 7-9 yrs

1.Any Automation Testing experience.
2. Experience in AS400
3.Banking domain- Treasury Management is a must.

If interested,send your profile to sushma.ty@gmail.com
Buzy bee Comment by Buzy bee on October 6, 2009 at 12:19pm
Hi , Can any one tell me please ,for qtp certification exam does it require to give QC exam also ?
!ndra Comment by !ndra on July 20, 2009 at 5:05pm
Its a nice article: http://www.greencrosssociety.com/azim_prenji_speech.htm

-!ndra
REDDY SIVA SARAN.K Comment by REDDY SIVA SARAN.K on July 10, 2009 at 3:03pm
Hi to all,
Can any one tell some doughts regarding QTP
My mail id is sivasaran558@gmail.com

Plz respond for this
 

Members (106)

tarun Thirupathi Arunsingh Rajathi Rajesh mpanwar nidhi Venkataraman Sanju Punam ebinezar John Mathew Israel Godwin Raj Vijayaraj Jayshree Rathod Sanjay Dange Gowtham Girish Naveen Kumar H S hari pradeep sbudakoti Manjunath  N REDDY SIVA SARAN.K Sreenath Gopalakrishnan Kishor Sachin Dhall Praveen kumar Kannan EDISTA balakrishna Anant Vyas
 
 

TR on the NET

 /></a></p> <p style=

Members

  • Priyanka
  • chandresh
  • D_Test
  • Pradeep Soundararajan
  • Suresh
  • Varun Menon
 

© 2010   Created by EDISTA

Badges  |  Report an Issue  |  Privacy  |  Terms of Service

Sign in to chat!