Skip to content

Opera is not working #343

Closed
Closed

Description

Hers is the code

 public function testOperaBrowser()
    {
        $desired_capabilities = DesiredCapabilities::opera();
        $desired_capabilities->setCapability('acceptSslCerts', true);
        $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();

    }

Error Message 

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


Curl error thrown for http POST to /session with params: {"desiredCapabilities":{"browserName":"opera","platform":"ANY","acceptSslCerts":true}}

Operation timed out after 30004 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:51

Activity

  1. OndraM commented on Oct 15, 2016

    @OndraM
    Collaborator

    Hi @smunukuntla, what version of Opera do you use? If it is one of the latest blink-based Opera (version >12), you have to use operablink as name of the browser. The opera v12 and older are no longer supported by Selenium Server.

    The support for the Opera-Blink is currently not builtin to php-webdriver helper functions, but you can easily do it manually:

    $desired_capabilities = new DesiredCapabilities();
    $desired_capabilities->setBrowserName('operablink');
    

    Due to bug in OperaChromiumDriver you also have to define path to opera binary (operasoftware/operachromiumdriver#9), like this:

    $desired_capabilities->setCapability('chromeOptions', ['binary' => '/usr/bin/opera']);
    

    With this set-up and with Opera 40.0.2308.54 it does work for me. However, I created new issue (#344) to track the built-in support of Opera in php-webdriver.

  2. salarmehr commented on Jun 30, 2017

    @salarmehr

    @OndraM Trying this in Windows I get:

     PHP Fatal error:  Uncaught Facebook\WebDriver\Exception\UnknownServerException: The path to the driver executable must be set by the webdriver.opera.driver system property; for more information, see https://github.com/operasoftware/operachromiumdriver. The latest version can be downloaded from https://github.com/operasoftware/operachromiumdriver/releases in C:\www\www\webdriver\vendor\facebook\webdriver\lib\Exception\WebDriverException.php:114
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions