agouti icon indicating copy to clipboard operation
agouti copied to clipboard

Unable to switch tabs

Open tite54296 opened this issue 7 years ago • 7 comments

This is a replica of bug #119 since the issue was closes before I could answer to @sclevine. "Is it possible to switch between browser tabs? I tried using SwitchWindow and does not seem to work. I also used WindowCount to validate that the new tab is being recognized as a window but does not seem like it since it is returning 1 instead of 2 which is the number of tabs at the time." I am using the WindowCount but it is returning only one window even though two tabs are opened.

tite54296 avatar Oct 12 '17 00:10 tite54296

As asked in #119, what webdriver and browser are you using with Agouti?

sclevine avatar Oct 12 '17 00:10 sclevine

I am using chromedriver and chrome.

tite54296 avatar Oct 12 '17 00:10 tite54296

Thanks, do you observe the same behavior with other webdrivers (ex. Chrome via Selenium, or Firefox via Selenium)?

sclevine avatar Oct 12 '17 00:10 sclevine

I would have to check. Let me check it tomorrow and come back to.you.

tite54296 avatar Oct 12 '17 00:10 tite54296

Hi @sclevine this is happening with all of the drivers. This is the scenario: I am currently testing an electron app using the agouti webdriver (so far, so good). For this app I need to register to a website first, so I instantiate a driver for the electron app and another for the webpage. Now, the issue shows up when i click a button in my electron app that opens a browser tab, I thought that since the tab is opened within the same browser I am using with agouti It should detect the new tab even though it was opened from the electron app.

tite54296 avatar Oct 12 '17 14:10 tite54296

To clarify, you've only observed this behavior when using two webdrivers simultaneously, one with electron, and one with a real browser?

Agouti is just a wrapper for the API endpoints provided by the webdrivers. If this scenario isn't supported by the webdrivers, there unfortunately isn't much we can do in Agouti to make it work.

As a workaround, could you grab the new browser tab link instead of clicking the button, and then open that link using a new webdriver instance? That should give both webdrivers control over their respective pages.

sclevine avatar Oct 16 '17 14:10 sclevine

I'll try that. Thanks :)

tite54296 avatar Oct 16 '17 19:10 tite54296