I have a web page.In that i have two links called "gmail"
and "gmail". Both links are look same.One link is at top of
the page and other link is at bottomn of the page. How the
automation tool can be recognized these link and make to
click the link i want?
Answer Posted / kamakshya
Using "Index" ordinal identifier
SystemUtil.Run "iexplore.exe","google.com"
Browser("title:=Google").Page("title:=Google").WebEdit
("name:=q").Set "QTP script"
Browser("title:=Google").Page("title:=Google").WebEdit
("name:=q").Submit
Wait(5)
Browser("name:=QTP script - Google Search").Page
("title:=QTP script - Google Search").WebButton
("name:=Search","index:=0").Highlight
wait(5)
Browser("name:=QTP script - Google Search").Page
("title:=QTP script - Google Search").WebButton
("name:=Search","index:=1").Highlight
Important Note: Interchange the index value and run the
test and observe how the ‘Search’ Button is working.
*********************************************
Using ‘Location’ Ordinal Identifier
SystemUtil.Run "iexplore.exe","google.com"
Browser("title:=Google").Page("title:=Google").WebEdit
("name:=q").Set "QTP script"
Browser("title:=Google").Page("title:=Google").WebEdit
("name:=q").Submit
Wait(5)
Browser("name:=QTP script - Google Search").Page
("title:=QTP script - Google Search").WebButton
("name:=Search","Location:=0").Highlight
wait(5)
Browser("name:=QTP script - Google Search").Page
("title:=QTP script - Google Search").WebButton
("name:=Search","Location:=1").Highlight
Is This Answer Correct ? | 0 Yes | 1 No |
Post New Answer View All Answers
How can we make one test method dependent on other using testng?
what is the dictionary objects in QTP? and what is method of vb script using virtual object wizard........
What is a ‘test plan’? What is a ‘test case’?
What is tsl?
Hi I need the following information about JMeter 1) How many(max) threads(users) can hit the website using Jmeter? 2) How long(in hours) can we run Jmeter for stress test? (Is there any “Memory full” issue if we run for long time?) 3)What typeof sampler to use for clicking on the link?
Do you know how can we make one test method dependent on other using testng?
What steps are needed in developing and running a software test?
What is a critical bug in a testing field?
What are the different types of scripting techniques for automation testing?
What generally is the structure of a framework?
What is the purpose of getoptions() method?
Tell us what is the alternate way to click on login button?
What all different approaches can be used for designing an automation solution?
What are the things that one should consider for selecting a project for test automation? For example, stability, etc.
Tell me what is an absolute xpath?