jumper423 / yii2-php-webdriver-bindings

Automatically exported from code.google.com/p/php-webdriver-bindings
1 stars 0 forks source link

Get window handle information #16

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. Try to get current window handle or all window handles from WebDriver

What is the expected output? What do you see instead?

Able to get window handles

Please provide any additional information below.

The current bindings lack this feature set. They would be useful in conjunction 
with WebDriver->selectWindow();

I've implemented it myself. Attaching code patch for WebDriver.php within 
comment itself below:

/**
     * Get the window handle of the current browser window
    */
    public function getWindowHandle() {
        $request = $this->requestURL . "/window_handle";
        $response = $this->execute_rest_request_GET($request);
        return $this->extractValueFromJsonResponse($response);
    }

    /**
     * Get the window handles of all (open) browser windows
    */
    public function getWindowHandles() {
        $request = $this->requestURL . "/window_handles";
        $response = $this->execute_rest_request_GET($request);
        return $this->extractValueFromJsonResponse($response);
    }

Original issue reported on code.google.com by manga...@gmail.com on 22 Dec 2011 at 12:18

GoogleCodeExporter commented 8 years ago

Original comment by manga...@gmail.com on 9 Mar 2013 at 6:41

GoogleCodeExporter commented 8 years ago

Original comment by manga...@gmail.com on 9 Mar 2013 at 6:43

GoogleCodeExporter commented 8 years ago
Fixed in revision 68 and revision 69.

Original comment by manga...@gmail.com on 9 Jun 2013 at 2:58