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

Explain about basics of rational robot - ibm test automation tool?

638


What are the important operations in database testing?

636


How to check if an element is visible on the page?

618


When is automation testing useful?

648


How can the user get a text of a web element?

616






wat would be the -ve test case for search where u can brak it ,tell dnt tell abt spl characters insertion ,boundary values chk.

1513


Do you know what is the difference between "type" and "typeandwait" command?

628


How can you create html test report from your test script?

566


Do you know how can we make one test method dependent on other using testng?

652


What u mean by infrgistics control (What is infrgistics Controls)?

1700


What is junit? And what is junit annotation?

612


Is automation testing a complete replacement for manual software testing?

711


Tell me what is tsl? What 4gl is it similar too?

663


hi to all, if we open a browser(for ex. yahoomail.com) using navigate command. the cursor by default focussing on the 'yahoo id' html edit box. how to get the label(ie.,yahoo id) of that html edit box using descriptive program. here we should not use identify tool to get the property,thtml editbox method. by tracing the cursor position we have to get the label name. is it possible? please let me know.

1831


can any one please tell me QTP 9.2 supports which version of IE and Mozilla firefox.

1835