Hegwin.Me

Time doth transfix the flourish set on youth. And delves the parallels in beauty's brow.

How to handle javascript confirm with selennium webdriver

Selenium driver 对 JS Confirm 的处理

JS popup confirmation box is often used in web development, how does the feature test script handle this popup box?

# ruby
page.driver.browser.switch_to.alert.accept # => click OK

page.driver.browser.switch_to.alert.dismiss # => click Cancel

page.driver.browser.switch_to.alert.text #=> return popup text

Reference: selenium-webdriver documentation

< Back