Hi there,
I am unable to switch focus between tabs in Chrome, Where as control can be shifted between the tabs using "browser.switchTo().window( handles[1] )".
Scenario: I am dealing with 3 tabs, currently 3rd tab is in focus. With the above snippet I can switch the control to 2nd tab. Once I switch the control to the 2nd tab, I am unable to perform some actions like selecting an option from dropdown, it is throwing "No such element available error". If I am able to switch the focus I can perform all actions without any issues. But there is no function available in Protractor to switch the focus between tabs.
Additional Info:
Protractor Version: 3.1,
Chrome Version: 54.
Regards,
Charvaka.
I see the same issue - here's the ChromeDriver bug tracking this: https://bugs.chromium.org/p/chromedriver/issues/detail?id=1315
From the team response, it sounds like changing tab focus is out of scope, but theoretically commands should work the same on the window whether it is focused or not.
It sounds like the root problem for you is that the option dropdowns are not available when not focused. This is working properly on my machine, so it's possible that it's a system issue. Here is my test case:
it('should interact with a new tab', function() {
browser.ignoreSynchronization = true;
browser.get('http://www.protractortest.org/testapp/');
browser.sleep(500);
browser.actions().keyDown(protractor.Key.COMMAND).perform();
element(by.css('a')).click();
browser.sleep(2000);
browser.getAllWindowHandles().then(function(handles) {
browser.switchTo().window(handles[1]);
browser.sleep(2000);
element(by.css('select')).click();
element.all(by.css('option')).get(2).click();
browser.sleep(2000);
});
});
Can you see if that works on your machine, and if not, open up an issue with Chromedriver?
Any progress on this ?!
Most helpful comment
Any progress on this ?!