Page 1 of 1

Current tab in a browser

Posted: Thu Aug 30, 2012 7:01 am
by ant_katcin
Hello.

I need to find WebDocument for current opened tab in specified browser window. I need to do that for all major browsers, but for now i'm trying with Firefox. I can access list of tabs to find which of TabPage is selected, but i don't know how to get corresponded dom element. First idea is using TabPage title, but looks this tilte can be the same for few tabs.

Any ideas?

Re: Current tab in a browser

Posted: Thu Aug 30, 2012 8:15 am
by Support Team
Hi,
ant_katcin wrote:I need to find WebDocument for current opened tab in specified browser window. I need to do that for all major browsers, but for now i'm trying with Firefox. I can access list of tabs to find which of TabPage is selected, but i don't know how to get corresponded dom element. First idea is using TabPage title, but looks this tilte can be the same for few tabs.

Any ideas?
You can use the following RanoreXPaths to identify the dom objects of the current active tabs for all supported browser:

Firefox: /dom[@browsername='Mozilla' and @visible='True']
IE: /dom[@browsername='IE' and @visible='True']
Chrome: /dom[@browsername='Chrome' and @visible='True']
Safari: /dom[@browsername='Safari' and @visible='True']

Regards,
Tobias
Ranorex Team

Re: Current tab in a browser

Posted: Fri Aug 31, 2012 10:18 am
by ant_katcin
Thanks a lot.

Re: Current tab in a browser

Posted: Tue Sep 18, 2012 8:20 am
by ant_katcin
Looks this solution doesn't work for my Jenkins server.

There is a VM machine with tests. Tests are work fine if i connected to remote desktop and look how it's work. But if i close remote desktop connection (without logging off as tests are working using user logon but not service logon) Ranorex can't find a tab however it still can run browser and type urls in address bar. As i understand problem with @visible='True'. Tab is active, but it doesn't visible.

UPD. Moreover, looks it can't find DOM at all:

No element found for path 'dom[@browsername='Chrome']/.//a[@innertext~'session_test']

Re: Current tab in a browser

Posted: Wed Sep 19, 2012 1:35 pm
by Support Team
Hi,

Please take a look at the section about "Remotely working with Ranorex" of the User Guide: Do not Close or Minimize the RDP Window.

Regards,
Markus
Ranorex Support Team

Re: Current tab in a browser

Posted: Tue Dec 18, 2012 8:33 am
by baburman
Hi ant_katcin,

Though it's a few months late i guess you can reply to this. Can you please provide the code which can access the tabs of the opened browser window? Is it developed in .NET?


Thanks,

baburman

Re: Current tab in a browser

Posted: Tue Dec 18, 2012 3:36 pm
by Support Team
Hi,

Are you using the Internet Explorer, FireFox, Chrome, or Safari?
Did you already try with Spy to track the different tabs or the elements shown in the tabs?
It would also help us if you could send us more information about what you are trying to do.
Would this be possible?

Thanks,
Markus