Current tab in a browser

Ask general questions here.
ant_katcin
Posts: 8
Joined: Thu Jun 14, 2012 2:52 pm

Current tab in a browser

Post by ant_katcin » Thu Aug 30, 2012 7:01 am

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?

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Current tab in a browser

Post by Support Team » Thu Aug 30, 2012 8:15 am

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
.
Image

ant_katcin
Posts: 8
Joined: Thu Jun 14, 2012 2:52 pm

Re: Current tab in a browser

Post by ant_katcin » Fri Aug 31, 2012 10:18 am

Thanks a lot.

ant_katcin
Posts: 8
Joined: Thu Jun 14, 2012 2:52 pm

Re: Current tab in a browser

Post by ant_katcin » Tue Sep 18, 2012 8:20 am

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']

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Current tab in a browser

Post by Support Team » Wed Sep 19, 2012 1:35 pm

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
.
Image

baburman
Posts: 1
Joined: Tue Dec 18, 2012 8:28 am

Re: Current tab in a browser

Post by baburman » Tue Dec 18, 2012 8:33 am

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

User avatar
Support Team
Site Admin
Site Admin
Posts: 11709
Joined: Fri Jul 07, 2006 4:30 pm
Location: Graz, Austria

Re: Current tab in a browser

Post by Support Team » Tue Dec 18, 2012 3:36 pm

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
.
Image