Alert from iframe
When we traverse inside iframes and hit an alert we can't go back up the chain to the original frame, because the alert is open.
We have to go back when the alert has been handled.
script | mock xml server setup | ||
add response | <html> <title>Start Page Title</title> <body> <input name="remove" type="button" value="Remove"> <iframe id="iframe1" src="frame1.html"></iframe> </body> </html> |
||
add response | <html> <body> <button onclick="confirm('Hello');">Open alert</button> <iframe id="iframe1_1" src="frame1_1.html"></iframe> </body> </html> |
for | GET: /FitNesseMock/frame1.html |
add response | <html> <body> <button onclick="confirm('Bye');">Open alert 2</button> </body> </html> |
for | GET: /FitNesseMock/frame1_1.html |
$url<-[http://127.0.0.1:8000/FitNesseMock] | get mock server url |
script | browser test | |
open | $url->[http://127.0.0.1:8000/FitNesseMock]/main | |
seconds before timeout | 2 | |
check | alert text | null |
click | Open alert 2 | |
check | alert text | Bye |
confirm alert | ||
note | we should be able to click Remove because we are back at top level | |
click | Remove | |
switch to frame | id=iframe1 | |
click | Open alert 2 | |
check | alert text | Bye |
dismiss alert | ||
note | we should be unable to click Remove because we are back at level 1 | |
reject | click if available | Remove |
switch to default content | ||
click | Open alert | |
check | alert text | Hello |
dismiss alert | ||
note | we should be able to click Remove because we are back at top level | |
click | Remove |
script | mock xml server setup |
stop |