w3c / webdriver

Remote control interface that enables introspection and control of user agents.
https://w3c.github.io/webdriver/
Other
678 stars 194 forks source link

Can't handle a child/new window's Alert on load #955

Open DeviPratik opened 7 years ago

DeviPratik commented 7 years ago
  1. Launch the Parent.html
  2. Handle the Alert on it
  3. Click on the link to open the "ChildWindow" as a new window 4. Try to handle the Alert on the "ChildWindow" ( program hangs )

Parent.html:

Click To open New/Child window

Child.html:

This is from ChildPage.html

andreastt commented 7 years ago

This repo tracks the the WebDriver specification itself.

shs96c commented 7 years ago

This may be a problem in the spec. The algorithm for Switch To Window contains a check for an active user prompt as the first step, and it's not clear that this should exclude those that can be handled by the Alert commands.

Should a new window be opened that immediately causes a user prompt to be displayed (eg. onload='alert("foo")') it becomes impossible to switch to that window.

andreastt commented 7 years ago

According to the spec, this should work. But we need a test case to prove this.