Golgappa.net | Golgappa.org | BagIndia.net | BodyIndia.Com | CabIndia.net | CarsBikes.net | CarsBikes.org | CashIndia.net | ConsumerIndia.net | CookingIndia.net | DataIndia.net | DealIndia.net | EmailIndia.net | FirstTablet.com | FirstTourist.com | ForsaleIndia.net | IndiaBody.Com | IndiaCab.net | IndiaCash.net | IndiaModel.net | KidForum.net | OfficeIndia.net | PaysIndia.com | RestaurantIndia.net | RestaurantsIndia.net | SaleForum.net | SellForum.net | SoldIndia.com | StarIndia.net | TomatoCab.com | TomatoCabs.com | TownIndia.com
Interested to Buy Any Domain ? << Click Here >> for more details...

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


Please Help Members By Posting Answers For Below Questions

Bug report formate in bugzilla

2052


Tell me what are pros and cons of automating tests at ui layer?

1031


Explain me how do you send enter/tab keys in webdriver?

938


What are the different types of locks in mainframe?

928


Why do you want to keep this kind of information in a separate file and not directly in the code?

967


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

2062


How will you automate basic “login” functionality test cases for an application?

946


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)

2108


Give some examples for test management tools?

1084


What are the types of the framework used in software automation testing?

1040


When is automation testing useful?

971


wat is database testing....how to develop data driven framework in selenium enviromnent. please explaing in detail

2052


What is junit annotation?

1016


What is the Differnce between Client/Server Testing and Web Based Testing?

9285


Mention a few good practices while performing automation testing.

950