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
Bug report formate in bugzilla
Tell me what are pros and cons of automating tests at ui layer?
Explain me how do you send enter/tab keys in webdriver?
What are the different types of locks in mainframe?
Why do you want to keep this kind of information in a separate file and not directly in the code?
hello frnds this pooja i hav started working on selenium with java ecllipse frnds could u tell me how to handle popup windows and security alerts i m jst trying and couldn't do anything plz help
How will you automate basic “login” functionality test cases for an application?
1. How would you Test & then automate an antivirus application? 2. How would u test & automate windows screen saver? (expected: "test scenarios" & "test approch": points)
Give some examples for test management tools?
What are the types of the framework used in software automation testing?
When is automation testing useful?
wat is database testing....how to develop data driven framework in selenium enviromnent. please explaing in detail
What is junit annotation?
What is the Differnce between Client/Server Testing and Web Based Testing?
Mention a few good practices while performing automation testing.