Geeks Talk

Prepare for your Next Interview


Welcome to the Geeks Talk forums.

You are currently viewing our boards as a guest which gives you limited access to view most discussions and access our other features. By joining our free community you will have access to post topics, communicate privately with other members (PM), respond to polls, upload content and access many other special features. Registration is fast, simple and absolutely free so please, join our community today!

If you have any problems with the registration process or your account login, please contact contact us.

Code to click on 6 button

This is a discussion on Code to click on 6 button within the QTP forums, part of the Software Testing category; Question asked by visitor If there are 10 buttons with same logical name and all properties are same, in different locations. now i want to write code to click on ...

Go Back   Geeks Talk > Software Testing > QTP
Register Blogs FAQ Tag Cloud Calendar Mark Forums Read
  #1 (permalink)  
Old 03-15-2007
Expert Member
 
Join Date: Feb 2007
Posts: 1,279
Thanks: 0
Thanked 191 Times in 153 Posts
Geek_Guest has a spectacular aura aboutGeek_Guest has a spectacular aura aboutGeek_Guest has a spectacular aura about
Code to click on 6 button

Question asked by visitor

If there are 10 buttons with same logical name and all properties are same, in different locations. now i want to write code to click on 6 button .
Reply With Quote
Sponsored Links
  #2 (permalink)  
Old 03-15-2007
Contributing Member
 
Join Date: Feb 2007
Location: Madras
Posts: 72
Thanks: 11
Thanked 7 Times in 7 Posts
raghav.kamal is on a distinguished road
Re: Code to click on 6 button

As of my understanding I suppose using Virtual buttons would help u out..Because it will recognise on the name given by us..
Correct me if im wrong!!
Reply With Quote
  #3 (permalink)  
Old 03-15-2007
Contributing Member
 
Join Date: Feb 2007
Location: Delhi
Posts: 51
Thanks: 3
Thanked 12 Times in 6 Posts
smganesh is on a distinguished road
Re: Code to click on 6 button

Hi,

No need to use virtual objects. use descriptive programming. The code would be something like:

Browser("Name").page("Name").Link("ClassName:=WebLink", "Name:=LogicalName", "index:=5").click

This should work. Also, note that index starts with 0.
Reply With Quote
The Following 2 Users Say Thank You to smganesh For This Useful Post:
  #4 (permalink)  
Old 03-15-2007
Contributing Member
 
Join Date: Feb 2007
Location: Madras
Posts: 72
Thanks: 11
Thanked 7 Times in 7 Posts
raghav.kamal is on a distinguished road
Re: Code to click on 6 button

U r right ganesh ..Actually i did that but i forgot to tell him..
Anyway thanks for reminding
Reply With Quote
  #5 (permalink)  
Old 04-20-2007
Expert Member
 
Join Date: Apr 2007
Location: Kolkata
Posts: 151
Thanks: 3
Thanked 11 Times in 10 Posts
debleena23 is on a distinguished road
Re: Code to click on 6 button

Absolutely right..... Just that there is no need to give the property "ClassName".
Because, when you write "Browser("Name").page("Name").WebLink/WebButton" it is already identified as a Weblink or WebButton.
So you can just write....
Browser("Name").Page("Name").WebButton("Name:=LogicalName", "index:=5").click
Reply With Quote
  #6 (permalink)  
Old 07-04-2007
Junior Member
 
Join Date: Jul 2007
Location: hyderabad
Posts: 4
Thanks: 0
Thanked 0 Times in 0 Posts
gopathipraveen is on a distinguished road
Re: Code to click on 6 button

Thanks ganesh it is very use full to me
Reply With Quote
  #7 (permalink)  
Old 07-11-2007
Contributing Member
 
Join Date: Feb 2006
Location: Beverly, Boston
Posts: 43
Thanks: 1
Thanked 1 Time in 1 Post
smartarun is on a distinguished road
Re: Code to click on 6 button

Browser("Name").Page("Name").WebButton("Name:=LogicalName", "index:=5").click

Change the index property and see.

It will work.

Arun*
Reply With Quote
  #8 (permalink)  
Old 09-16-2007
Junior Member
 
Join Date: Apr 2007
Location: India
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
rkiran416 is on a distinguished road
Re: Code to click on 6 button

Can you please let me know the code how to do the above scenario for a Windows based application?
Reply With Quote
  #9 (permalink)  
Old 09-16-2007
Contributing Member
 
Join Date: Nov 2006
Location: India
Posts: 79
Thanks: 3
Thanked 16 Times in 11 Posts
j_madhuri is on a distinguished road
Re: Code to click on 6 button

Thanks for the information.It really helped me
Reply With Quote
Reply

  Geeks Talk > Software Testing > QTP

Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is On
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads

Thread Thread Starter Forum Replies Last Post
Selecting Radio Button JobHelper QTP 4 03-17-2009 10:49 AM
Validate Print button in webbased application JobHelper QTP 3 07-15-2008 08:31 AM
Test cases for Push Button Srikanth Test Cases 7 05-16-2007 07:32 AM
Menu found disappeared and Right click does not work sagar007 Geeks Lounge 0 02-21-2007 04:29 AM
Browse Button Testcases bharathi_ark Test Cases 1 12-16-2006 07:07 AM


All times are GMT -4. The time now is 05:35 AM.


Powered by vBulletin® Version 3.8.4
Copyright ©2000 - 2009, Jelsoft Enterprises Ltd.
Content Relevant URLs by vBSEO 3.3.1
Copyright © 2009 GeekInterview.com. All Rights Reserved