![]() Server : Apache System : Linux server2.corals.io 4.18.0-348.2.1.el8_5.x86_64 #1 SMP Mon Nov 15 09:17:08 EST 2021 x86_64 User : corals ( 1002) PHP Version : 7.4.33 Disable Function : exec,passthru,shell_exec,system Directory : /home/corals/old/vendor/php-webdriver/webdriver/lib/ |
<?php namespace Facebook\WebDriver; use Facebook\WebDriver\Remote\DriverCommand; use Facebook\WebDriver\Remote\ExecuteMethod; /** * An abstraction allowing the driver to manipulate the javascript alerts */ class WebDriverAlert { /** * @var ExecuteMethod */ protected $executor; public function __construct(ExecuteMethod $executor) { $this->executor = $executor; } /** * Accept alert * * @return WebDriverAlert The instance. */ public function accept() { $this->executor->execute(DriverCommand::ACCEPT_ALERT); return $this; } /** * Dismiss alert * * @return WebDriverAlert The instance. */ public function dismiss() { $this->executor->execute(DriverCommand::DISMISS_ALERT); return $this; } /** * Get alert text * * @return string */ public function getText() { return $this->executor->execute(DriverCommand::GET_ALERT_TEXT); } /** * Send keystrokes to javascript prompt() dialog * * @param string $value * @return WebDriverAlert */ public function sendKeys($value) { $this->executor->execute( DriverCommand::SET_ALERT_VALUE, ['text' => $value] ); return $this; } }