Chrome browser multiple tab switching is not working ( Mac OS + 2.23 Chrome )

678 views
Skip to first unread message

Vikram

unread,
Aug 15, 2016, 2:54:52 PM8/15/16
to Selenium Users
Hi All,

I have requirement to navigate between multiple tabs in chrome browser. ( Mac OS 10.11 + Chrome 2.23 )

But I couldn't get it done with any of the below solutions

http://stackoverflow.com/questions/25525209/switch-between-browser-tabs-using-selenium-webdriver-with-java/27174084#comment65273020_27174084

http://stackoverflow.com/questions/29455355/how-to-switch-to-another-tab-using-selenium-webdriver-with-java/29458511#comment65271947_29458511

http://stackoverflow.com/questions/28967901/how-do-i-control-new-tabs-with-selenium-webdriver-after-they-are-opened

Is it broken in latest chrome version ?

Anybody has working in Java , will be really helpful

Thanks & Regards,
Vikram

Aidan McCoy

unread,
Aug 15, 2016, 10:49:50 PM8/15/16
to Selenium Users
As somewhat explained in the second solution, the method of creating an array of the window handles and then switching windows by indexing through the list has given me the best results. Are you able to get the window handles at all? 

Vikram

unread,
Aug 16, 2016, 4:22:50 AM8/16/16
to Selenium Users
Hi Aidan,

I'm getting 2 windows handles but can't navigate to each of them.

I didn't find any bug on latest chrome driver , not sure if this is new issue got introduced ?

Thanks,
Vikram

Aidan McCoy

unread,
Aug 16, 2016, 3:02:41 PM8/16/16
to Selenium Users
Have you tried running the same code on another browser? I am having a similar issue myself. I am trying to accept a popup in chrome with a remoteWebDriver but it is unable to accept the alert but I have no issues in safari, IE, and firefox. I think since you have to call a switchTo().alert() to get to the alert our issues might have a similar solution. Can you accept alerts on your chrome?

Vikram

unread,
Aug 18, 2016, 4:58:04 AM8/18/16
to Selenium Users
Hi Aidan,

As our customer use Chrome ,need to get it working in Chrome didn't try in other browser.

I'm using below code

String firstTab = getDriver().getWindowHandle();

ArrayList<String> sWindows = new ArrayList<String>(getDriver().getWindowHandles());
for(String window: sWindows){ if( !window.equals(firstTab) ){ secondTab = window; } }


As per stackover flow this should work fine , currently tracking issue with https://bugs.chromium.org/p/chromedriver/issues/detail?id=1465

Regards,
Vikram

Purushotham Karimbedu

unread,
Aug 18, 2016, 5:35:42 AM8/18/16
to seleniu...@googlegroups.com

---
Thanks & Regards,
Purushotham Karimbedu,
Drupal Developer and QA Engineer,
Phone no: 09000109120.


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-users+unsubscribe@googlegroups.com.
To post to this group, send email to selenium-users@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/964dc7fa-49e0-4dc4-bc33-1e0ee352e907%40googlegroups.com.

For more options, visit https://groups.google.com/d/optout.

Vikram

unread,
Aug 19, 2016, 7:24:47 AM8/19/16
to Selenium Users
Thanks Purushotham for detailed info.

To conclude on this topic , I got info on the ticket filed; that with current version of chromedriver shifting do happen but it's not visible to user.

Regards,
Vikram
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to seleniu...@googlegroups.com.
Reply all
Reply to author
Forward
0 new messages