cancel
Showing results for 
Search instead for 
Did you mean: 

Chrome: Switching between multiple Tabs

SOLVED
Highlighted
Contributor

Chrome: Switching between multiple Tabs

The Web application I am testing at a point when selecting multi links will open a tab per link.

 

When opening 1 link, I am already focused to that Tab and when I do the Close button on that page I am directed back to the original Dashboard page of the web app.

 

When I have more then 1 Tab, how can I switch between the 2 or more Tabs created from these links.

 

I'm using JScript.

 

I have written some code to reflect that the 2 Page object are there and dumping out VisibleOnScreen

that displays the correct values.

 

But going through posts/solutions in the forum, I have not seen a solution to help me focus on 1 Tab to the other.

 

function fndrectab()

{

   rec1Obj = Sys.Browser("chrome").Page("http://something.com/rec/#/details/111/editor/inst?mode=edit");

   rec2Obj = Sys.Browser("chrome").Page("http://something.com/rec/#/details/222/editor/inst?mode=edit");

 

if(rec1Obj.Exists)

{

  Log.Message("Rec 1 found");

  Log.Message(rec1Obj.VisibleOnScreen);

} 

Delay(1000);

 

// rec2Obj.Click(); works to focus on Tab I want to see, but gives a warning

// 'The action may be performed incorrectly, because the control is not visible.

 

if(rec2Obj.Exists)

{

  Log.Message("Rec 2 found");

  Log.Message(rec2Obj.VisibleOnScreen);

}

 

}

 

Would like to know how to going from rec1Obj Tab to rec2Obj Tab.

 

Thanks,

 

JamesK
1 ACCEPTED SOLUTION

Accepted Solutions
Contributor

Re: Chrome: Switching between multiple Tabs

 

I think I will try the following:

create a loop

Sys.Browser("chrome").Page("http://something.com/*").Keys("^[Tab]");

Check when the Tab(page) I want is VisibleOnScreen

break out of Loop

And I should be on the Tab I want to work with

 

 

JamesK
1 REPLY 1
Contributor

Re: Chrome: Switching between multiple Tabs

 

I think I will try the following:

create a loop

Sys.Browser("chrome").Page("http://something.com/*").Keys("^[Tab]");

Check when the Tab(page) I want is VisibleOnScreen

break out of Loop

And I should be on the Tab I want to work with

 

 

JamesK
New Here?
Join us and watch the welcome video:
SeptemberNews
Join the September Hub-bub to show off, learn and win