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?

Answers were Sorted based on User's Feedback



I have a web page.In that i have two links called "gmail" and "gmail". Both lin..

Answer / uday

Why cant you use index or location property.

By default, index=0 for the first object and index=1 to the
second object.

Is This Answer Correct ?    5 Yes 0 No

I have a web page.In that i have two links called "gmail" and "gmail". Both lin..

Answer / kalt

Hi, If you are looking for the solution form selenium, then
you can use the xpath to click on that link.

Is This Answer Correct ?    4 Yes 0 No

I have a web page.In that i have two links called "gmail" and "gmail". Both lin..

Answer / mohammad murtuza ali

we have to give a tool tip to identify which link is
redirecting.
by this it is possible

Is This Answer Correct ?    3 Yes 1 No

I have a web page.In that i have two links called "gmail" and "gmail". Both lin..

Answer / shamsher singh

Object repository have details about both link . when e
write test cases we can use these details(properties of the
Object) and recognize the link at run time.

Is This Answer Correct ?    1 Yes 1 No

I have a web page.In that i have two links called "gmail" and "gmail". Both lin..

Answer / 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

More Automation Testing AllOther Interview Questions

What are the steps to perform Load and Stress testing on a Website? What resources do I need to do this? Please advise. Thanks in advance.

0 Answers  


What generally is the structure of a framework?

0 Answers  


If testing is done using white box testing,then what is the need of using Black box testing again? I mean when unit testing and Integration testing is done at Coding level, what is the need of testing again at testing level?

1 Answers  


Explain me what is testng and why is it better than junit?

0 Answers  


Please name a couple of standard web function found in the function generator?

0 Answers  






What factors determine the effectiveness of automation testing?

0 Answers  


Hi, Below is the code that i ran on selenium RC using eclipse IDE and java coding.: package source; import org.testng.annotations.BeforeSuite; import org.testng.annotations.Test; import com.thoughtworks.selenium.*; public class parameterized extends SeleneseTestCase { private Selenium browser; public static void main(String []args) { String arr[] = new String[5]; arr[0]= "bert"; arr[1]= "regular"; arr[2]= "copyonly"; arr[3]= "doert"; arr[4]= "inter"; parameterized obj = new parameterized(); obj.setUp(); obj.login_parameterize(arr); } @BeforeSuite public void setUp() { browser = new DefaultSelenium("localhost",4444, "*chrome", "http://goolge.com"); browser.start(); browser.open("http://goolge.com"); browser.waitForPageToLoad("30000"); browser.windowMaximize(); browser.open("/"); browser.click("gb_23"); } @Test public void login_parameterize(String[] arr ) { for(int i=0;i<=5;i++) { for(int j=0;j<=2; j++) { browser.type("//input[@id='Email']", arr[i]); browser.type("//input[@id='Passwd']", arr[i]); browser.click("//input[@id='signIn']"); browser.waitForPageToLoad("30000"); } } } public void EnterValuesIntoTextField_CheckWithGetValue() throws Exception { selenium.open("http://www.essaywriter.co.uk"); assertEquals("", selenium.getValue("id=textInput")); selenium.type("id=textInput", "Text In The Field"); assertEquals("Text In The Field", selenium.getValue("id=textInput")); } } When i ran this test i got an error which says: "Method login_parameterize requires 1 parameters but 0 were supplied in the @Test annotation." Any help is much appreciated. thank Gab

0 Answers  


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

0 Answers  


Hi every body.. Whn i install QC 9.2 in window xp sp2 it ll show the error msg as it will nt support. How can i install in this OS.. Plz plz help me and i installed IIS and oracle 8i.. Plz Plz help me for this one

1 Answers  


hi, I want to study TIA portla V11. where can I get online courses?

0 Answers  


What are the advantages of the automation framework?

0 Answers  


Hi, I wanted to go with TestingDomain-Automation. Regarding this I need to take training on any one tool either WinRunner or LoadRunner. Which is better to get job,having future and takes lesstime with easier***. pls mention one tool name. Basically iam manual test engineer on unix- platform.

0 Answers  


Categories