WebDriver\Session::frame PHP Method

frame() public method

frame methods: /session/:sessionId/frame (POST) - $session->frame($json) - change focus to another frame on the page - $session->frame()->method() - chaining
public frame ( ) : Session | WebDriver\Frame
return Session | WebDriver\Frame
    public function frame()
    {
        if (func_num_args() === 1) {
            $arg = func_get_arg(0);
            // json
            $this->curl('POST', '/frame', $arg);
            return $this;
        }
        // chaining
        return new Frame($this->url . '/frame');
    }

Usage Example

Exemplo n.º 1
0
 /**
  * Switches to specific iFrame.
  *
  * @param string $name iframe name (null for switching back)
  */
 public function switchToIFrame($name = null)
 {
     $this->wdSession->frame(array('id' => $name));
 }