Working with (browser) tabs

Ask general questions here.
User avatar
Nicklas
Posts: 20
Joined: Mon Sep 26, 2011 2:53 pm
Location: Sweden

Working with (browser) tabs

Post by Nicklas » Tue Oct 11, 2011 10:12 am

Can someone explaing to me how to use tabs in code? Here's an example of what I'd like to do:

1. Open a new browser tab (in a opened browser)
2. Navigate to a specific page in the new tab
3. Return to the first tab (without closing the second one)
4. Return to the second tab and closing the first one

Also, using browser windows, how do I jump between open browser. If I have two IE8 browsers runnnig, how do I toggle between them? I'm looking for something like Browser2.Focus();


/Nicklas

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Working with (browser) tabs

Post by Support Team » Tue Oct 11, 2011 12:59 pm

Hi,

Please take a look at the following post, maybe it answered your questions:
http://www.ranorex.com/forum/dom-ensure ... t2690.html
You can close a tab by calling the Close() method of the WebDocument and open it with Host.Local.OpenBrowser("YourSite");.

Regards,
Markus
Ranorex Support Team

User avatar
Nicklas
Posts: 20
Joined: Mon Sep 26, 2011 2:53 pm
Location: Sweden

Re: Working with (browser) tabs

Post by Nicklas » Wed Oct 12, 2011 9:50 am

Okej, thanks. I understand how to open and close tabs now. But I still don't have a clue how to switch between them. I've read the post you linked to but I'm still confused.

In FF I can use EnsureVisible on an element and the correct tab will show, correct?

But how do I do it in IE? "...For IE you have to search the MSAA Element, because this Browser doesn't support tab switching with Ensure Visible.", what does that mean?


/Nicklas

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Working with (browser) tabs

Post by Support Team » Wed Oct 12, 2011 12:17 pm

Nicklas wrote:But how do I do it in IE? "...For IE you have to search the MSAA Element, because this Browser doesn't support tab switching with Ensure Visible.", what does that mean?
If you use IE9 then you can use following RxPath for the tabpagelist
/form[@processname='iexplore' and @class='IEFrame']//tabpagelist
But this could take a while to find this element. If you've found this element you can switch between the tabs by using the select action as you know it for MSAA elements.

Regards,
Peter
Ranorex Team

User avatar
Nicklas
Posts: 20
Joined: Mon Sep 26, 2011 2:53 pm
Location: Sweden

Re: Working with (browser) tabs

Post by Nicklas » Wed Oct 12, 2011 3:38 pm

Great! Still think it's a very strang and cumbersome way. Many other tools have a much simpler and easier way on working with browser tabs. However Ranorex still rocks :)

User avatar
Support Team
Site Admin
Site Admin
Posts: 12145
Joined: Fri Jul 07, 2006 4:30 pm
Location: Houston, Texas, USA
Contact:

Re: Working with (browser) tabs

Post by Support Team » Wed Oct 12, 2011 4:07 pm

Hi,
Nicklas wrote:Great! Still think it's a very strang and cumbersome way. Many other tools have a much simpler and easier way on working with browser tabs.
In Firefox, Chrome and Safari it is easier, because the Ensure Visible works. It is only the IE which doesn't support this feature. But I've added a feature request to our internal bug tracking list to create a way to make it easier for our users to switch between the IE tabs.
Nicklas wrote:However Ranorex still rocks :)
It is good to hear that our customers are that pleased with Ranorex. Thank you for the feedback. You are welcome.

Regards,
Peter
Ranorex Team