Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Does it support safari (mac), opera & edge browser for automation #335

Closed
ghost opened this issue Oct 6, 2016 · 11 comments
Closed

Does it support safari (mac), opera & edge browser for automation #335

ghost opened this issue Oct 6, 2016 · 11 comments
Labels

Comments

@ghost
Copy link

ghost commented Oct 6, 2016

Hi Team,

It worked fine for firefox & chrome but not with safari/edge/opera. Wondering like those browser implementations were not yet attached right ?

Please let me know what browser this bindings will work for ? I need to prepare my test plan accordingly. thanks in advance

@OndraM
Copy link
Collaborator

OndraM commented Oct 7, 2016

Hi, safari and opera should be supported. The initial Edge support was merged recently (and is not yet released in tagged version, but should be soon). If you use selenium server to access these browsers, it should work. (As much as these browsers support WebDriver, which I doubt a bit, especially for Opera).

@ghost
Copy link
Author

ghost commented Oct 14, 2016

Hi @OndraM , I tried running for safari after starting the selenium server with below code but It didn't worked -

Code :

public function testSafariBrowser()
    {
        $caps = array("OS"=>"Sierra", "browserName" => "safari", "version" => "10");
        //$desired_capabilities = DesiredCapabilities::safari();
        //$desired_capabilities->setCapability('acceptSslCerts', false);
        $driver = RemoteWebDriver::create('http://localhost:4444/wd/hub', $caps);
        $driver->get('http://docs.seleniumhq.org/');
        $driver->wait(10);
        echo "The title is '" . $driver->getTitle() . "'\n";
        $driver->quit();

    }

Error Message 

/usr/bin/php "/Users/smunukuntla/Documents/Selenium PHP/vendor/phpunit/phpunit/phpunit" --no-configuration --filter "/::testSafariBrowser( .*)?$/" Selenium_Drivers_Implementation "/Users/smunukuntla/Documents/Selenium PHP/tests/1_Selenium_Drivers_Browsers/Selenium_Drivers_Implementation.php" --teamcity
Testing started at 4:45 PM ...
PHPUnit 5.5.7 by Sebastian Bergmann and contributors.


Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"OS":"Sierra","browserName":"safari","version":"10"}}

Operation timed out after 30002 milliseconds with 0 bytes received
 /Users/smunukuntla/Documents/Selenium PHP/vendor/facebook/webdriver/lib/Exception/WebDriverException.php:92
 /Users/smunukuntla/Documents/Selenium PHP/vendor/facebook/webdriver/lib/Remote/HttpCommandExecutor.php:320
 /Users/smunukuntla/Documents/Selenium PHP/vendor/facebook/webdriver/lib/Remote/RemoteWebDriver.php:100
 /Users/smunukuntla/Documents/Selenium PHP/tests/1_Selenium_Drivers_Browsers/Selenium_Drivers_Implementation.php:42

@gabrielpreston
Copy link
Contributor

We don't utilize Safari here, so I don't have much experience getting it running. Did you go through these instructions yet for the Safari Driver? https://github.com/SeleniumHQ/selenium/wiki/SafariDriver

@ghost
Copy link
Author

ghost commented Oct 14, 2016

Yes. I did and In working on bindings in parallel like java and python. They are working but with php its not. Even opera had the same issue.

Sent from my iPhone

On Oct 14, 2016, at 4:54 PM, Gabriel Preston notifications@github.com wrote:

We don't utilize Safari here, so I don't have much experience getting it running. Did you go through these instructions yet for the Safari Driver? https://github.com/SeleniumHQ/selenium/wiki/SafariDriver


You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub, or mute the thread.

@ghost
Copy link
Author

ghost commented Oct 15, 2016

@gabrielpreston I'm using MAC Sierra / Safari 10.0 with below code. its not working and throws a message like cant create a session.

$desired_capabilities = DesiredCapabilities::safari();
//$desired_capabilities = array("platform"=>"MAC", "browserName" => "safari", "version" => "10");
//$desired_capabilities->setCapability('acceptSslCerts', false);
$driver = RemoteWebDriver::create('http://localhost:4444/wd/hub', $desired_capabilities);
$driver->get('http://docs.seleniumhq.org/');
$driver->wait(10);
echo "The title is '" . $driver->getTitle() . "'\n";
$driver->quit();

@OndraM
Copy link
Collaborator

OndraM commented Oct 15, 2016

@smunukuntla What is version of Selenium server you use? What command exactly do you use to start you Selenium server jar file?

And note, since Safari 10.0, the so-called SafariDriver from Selenium project (linked above) is no longer needed, as the WebDriver support should be builtin to Safari releases - see https://webkit.org/blog/6900/webdriver-support-in-safari-10/ .

@ghost
Copy link
Author

ghost commented Oct 15, 2016

@OndraM Im using latest selenium server version like 3.0 and starting with the regilar command like java -jar

Yes you r right about safari 10 and Im aware of it. I enabled automation option also for safari browser.

@ghost
Copy link
Author

ghost commented Oct 16, 2016

Hi @OndraM I have updated the selenium server from 3.0 beta 2 to 3.0 version and now its working for safari 10.0 as well. Thanks much

@ghost
Copy link
Author

ghost commented Oct 16, 2016

Worked for edge browser as well on WIN 10 Pro via Selenium GRID 3.0.0 with the below code

$desired_capabilities = new DesiredCapabilities();
$desired_capabilities->setBrowserName('MicrosoftEdge');
$desired_capabilities->setPlatform('WINDOWS');
$desired_capabilities->setCapability('acceptSslCerts', true);
$driver = RemoteWebDriver::create('http://10.211.55.5:7777/wd/hub', $desired_capabilities);
$driver->get('http://docs.seleniumhq.org/');
$driver->findElement(WebDriverBy::id('q'))->sendKeys('selenium 3');
$driver->findElement(WebDriverBy::id('submit'))->click();
sleep(3);
echo "The title is '" . $driver->getTitle() . "'\n";
$driver->quit();

@OndraM
Copy link
Collaborator

OndraM commented Oct 16, 2016

@smunukuntla Thanks for the valuable information! I found this in Selenium 3.0.0-beta4 changelog:

Remove OSS safaridriver in preference for Apple's own SafariDriver that ships as part of Safari 10.

So maybe the problem was when both drivers were present (what is no longer the case for Selenium 3.0.0-beta4 and newer).

@OndraM
Copy link
Collaborator

OndraM commented Oct 16, 2016

@smunukuntla I also created #345 to track local support for SafariDriver (ie. when not started through Selenium server, but locally through safardriver binary from Safari 10.0).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants