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
Explain about basics of rational robot - ibm test automation tool?
What are the important operations in database testing?
How to check if an element is visible on the page?
When is automation testing useful?
How can the user get a text of a web element?
wat would be the -ve test case for search where u can brak it ,tell dnt tell abt spl characters insertion ,boundary values chk.
Do you know what is the difference between "type" and "typeandwait" command?
How can you create html test report from your test script?
Do you know how can we make one test method dependent on other using testng?
What u mean by infrgistics control (What is infrgistics Controls)?
What is junit? And what is junit annotation?
Is automation testing a complete replacement for manual software testing?
Tell me what is tsl? What 4gl is it similar too?
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.
can any one please tell me QTP 9.2 supports which version of IE and Mozilla firefox.