_generated\WebGuyActions::switchToWindow PHP Method

switchToWindow() public method

Switch to another window identified by name. The window can only be identified by name. If the $name parameter is blank, the parent window will be used. Example: html php click("Open window"); # switch to another window $I->switchToWindow("another_window"); # switch to parent window $I->switchToWindow(); ?> If the window has no name, the only way to access it is via the executeInSelenium() method, like so: php executeInSelenium(function (\Facebook\WebDriver\Remote\RemoteWebDriver $webdriver) { $handles=$webdriver->getWindowHandles(); $last_window = end($handles); $webdriver->switchTo()->window($last_window); }); ?>
See also: Codeception\Module\WebDriver::switchToWindow()
public switchToWindow ( string | null $name = null )
$name string | null
    public function switchToWindow($name = null)
    {
        return $this->getScenario()->runStep(new \Codeception\Step\Action('switchToWindow', func_get_args()));
    }
WebGuyActions