Share
Go down
Test Engg
Posts : 2
Join date : 2012-08-31

Unexpected event handling in webdriver/ selenium

on Fri Aug 31, 2012 11:49 am
Is it possible for selenium to wait for an user input if an unexpected
event occurs in the script(like a message box/ new window/ warning /
alert or any other interruption)?
For example if some new functionality is added to the code and when
selenium script is run, the test shouldn't break but should wait for
manual intervention where the condition in the new functionality occurs. The expectation is that any new functionality added to the existing code(by developers) does not break our automation scripts.
sreekumar
Active particpant
Active particpant
Posts : 16
Join date : 2011-12-27
Age : 33
Location : Hyderabad

Re: Unexpected event handling in webdriver/ selenium

on Wed Sep 12, 2012 4:37 pm
If you want to use Alert ,messge box by using below code you can do that.Alert alert = driver.switchTo().alert();
// Get the text of the alert or prompt
alert
.getText();
// And acknowledge the alert (equivalent to clicking "OK")
alert
.accept();
Back to top
Permissions in this forum:
You cannot reply to topics in this forum