timeouts methods: /session/:sessionId/timeouts (POST)
- $session->timeouts($json) - set timeout for an operation
- $session->timeouts()->method() - chaining
public timeouts ( ) : |
||
return |
/** * Continuously poll the page, until you find an element * with the given name or id. * * @param string $element * @param integer $timeout * @return static */ public function waitForElement($element, $timeout = 5000) { $this->session->timeouts()->postImplicit_wait(['ms' => $timeout]); try { $this->findByNameOrId($element); } catch (InvalidArgumentException $e) { throw new InvalidArgumentException("Hey, what's happening... Look, I waited {$timeout} milliseconds to see an element with " . "a name or id of '{$element}', but no luck. \nIf you could take a look, that'd be greaaattt..."); } return $this; }
/** * Applies timeouts to the current session */ private function applyTimeouts() { try { foreach ($this->timeouts as $type => $param) { $this->wdSession->timeouts($type, $param); } } catch (UnknownError $e) { throw new DriverException('Error setting timeout: ' . $e->getMessage(), 0, $e); } }