andycha28 / php-webdriver-bindings

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

How to handle the popup window in webdriver #30

Open GoogleCodeExporter opened 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1.Popup window opened in the testcases ,i need to enter the username and 
password in the popup window
2. I don't know how to handle popup window 
3.

What is the expected output? What do you see instead?
I need to handle the popup window

What version of the product are you using? On what operating system?
php-maven plugin
In win,mac,linux

Please provide any additional information below.

Original issue reported on code.google.com by chelladu...@photoninfotech.net on 19 Jun 2012 at 7:12

GoogleCodeExporter commented 8 years ago
Hello,
My workaround:

Add to WebDriver.php

public function getWindowHandles() {
    $response = $this->execute_rest_request_GET($this->requestURL . "/window_handles");
    return $this->extractValueFromJsonResponse($response);
}

Example:

$allwindows = $webdriver->getWindowHandles();
$last_window = end($allwindows);
$webdriver->selectWindow($last_window);  // popup window

Good luck

Original comment by sidlausk...@gmail.com on 24 Jun 2012 at 2:40

GoogleCodeExporter commented 8 years ago
Getting window handles & selecting windows should be fixed in revision 68 and 
revision 69.

But popups from HTTP basic/digest authentication (for SSL) is not covered. In 
fact even Selenium 2 / WebDriver itself has no support for this. May have to 
use browser specific workarounds (Firefox profile settings), or AutoIt, or 
proxies.

Original comment by manga...@gmail.com on 9 Jun 2013 at 7:52