When testing I get a javascript alert box and I try closing it but I get error unexpected alert open: {Alert text : OK to remove this exclusion?}
I am trying to use:
$this->driver = new Selenium2Driver('chrome');
$this->driver->getWebDriverSession()->accept_alert();
What is the proper way to use PHP behat/mink selenium2 chrome webdriver to close an alert box?
Using Behat 3.2.0 mink 1.7.1
Could you check with this
$this->getSession()->getDriver()->getWebDriverSession()->accept_alert();
or
Could you try updating ConfirmPopup function in featureContext.php file as follows
public function iConfirmPopup()
{
$this->getMainContext()->getSession()->getDriver()->getWebDriverSession()->accept_alert();
}
add this in featureContext.php file
Reference Link solution to use alert(), confirm() and prompt() in Selenium2Driver
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With