Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

client.execute does not work if app closes initial window and opens another #69

Closed
hiddentao opened this issue Jun 23, 2016 · 3 comments

Comments

@hiddentao
Copy link

I have an app whose startup sequence is as follows:

  1. Show splash window for 5 seconds...then close it
  2. Open and show main app window

I wait for 10 seconds in my tests before issuing commands via the APIs. However they don't work because client.execute() doesn't work - and I think this is because the webdriver client API gets initialized agains the splash window since that shows up first - am I right?

How can I make it so that I can issue commands agains the main app window?

@kevinsawicki
Copy link
Collaborator

kevinsawicki commented Jun 23, 2016

How can I make it so that I can issue commands agains the main app window?

Does your main window have focus?

You can toggle which window commands get run using the https://github.com/electron/spectron#clientwindowbyindexindex API or one of the http://webdriver.io/api/protocol/window.html APIs.

Here is an example spec that checks multiple windows: https://github.com/electron/spectron/blob/fa824d66b26b47e2c06d4b3eddb0de372d31ad40/test/multi-window-test.js#L24-L42

Does that help?

@hiddentao
Copy link
Author

Thanks. I managed to bypass the problem by simply never showing the splash screen but I'll try your suggestion and let you know.

@kevinsawicki
Copy link
Collaborator

I managed to bypass the problem by simply never showing the splash screen but I'll try your suggestion and let you know.

Closing this out for now, please comment if you think this is an addressable issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants