How to switch between tabs in a browser using send keys method

4,302 views
Skip to first unread message

rags

unread,
May 2, 2012, 6:15:51 AM5/2/12
to QTP - HP Quick Test Professional - Automated Software Testing
there is application which consist of browse button, when i click
browse button it opens another tab in same browser where i need to
select a link.

Problem is when QTp is not able to recognize the 2nd tab . even i used
the Send keys methods but its not working....

set CLT_TAB = CreateObject("WScript.Shell")

'Browser("DMX Admin").Page("Control panel").Image("Menu
Manager").Click
'Browser("DMX Admin_3").Page("Menu manager- new
page").WebEdit("txtSubMenu").set "Testing Contact us sub menu"
'Browser("DMX Admin_3").Page("Menu manager- new
page").WebRadioGroup("select link").Select "1"
'Browser("DMX Admin_3").Page("Menu manager- new
page").Image("browse_btn").Click

CLT_TAB.SendKeys " %{TAB}"

'Browser("DMX Admin").Page("Static & section link page").Link("Contact
Us").Click
'Browser("DMX Admin").Page("Static & section link page").Sync
'Browser("DMX Admin").Page("Static & section link
page").Image("HeaderGetlink_img").Click
'Browser("DMX Admin_3").Page("Menu manager- new
page").Image("Save").Click


Thanks in advance

Deepak Kumar Mahapatro

unread,
May 2, 2012, 9:31:15 AM5/2/12
to mercu...@googlegroups.com
Try changing the browser option for tabbed browsing so that the pages open either in same window or new window.


--
You received this message because you are subscribed to the Google
"QTP - HP Quick Test Professional - Automated Software Testing"
group.
To post to this group, send email to Mercu...@googlegroups.com
To unsubscribe from this group, send email to
MercuryQTP+...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/MercuryQTP?hl=en



--
Regards,
Deepak

Anish Pillai

unread,
May 2, 2012, 11:18:57 AM5/2/12
to mercu...@googlegroups.com
Hi Rags,

QTP provides support for omnipresent tabbed browsing. So ideally there should not be any issues if you try to use the browser in 2nd tab. Only thing is that this browser should be accessed with CreationTime as 1.

Check the below link and see if it helps.

http://www.automationrepository.com/2012/01/how-to-work-with-multiple-tabs-in-a-single-browser-window/





--
ar

Shwetha Shiva

unread,
Dec 10, 2014, 4:36:54 AM12/10/14
to mercu...@googlegroups.com
Sometimes "^{TAB}" does not work.... 
So we can use below method...

hwnd = Browser("creationtime:=").GetROProperty("hwnd")
Window("hwnd:=" & hwnd).Type micLCtrlDwn
Set CT = CreateObject("WScript.Shell")
CT.SendKeys " {TAB}"
Window("hwnd:=" & hwnd).Type micLCtrlUp

Thanks,
Shwetha
Reply all
Reply to author
Forward
0 new messages