Skip to content

Can't open ChromeDriver without Selenium Standalone Server. #299

Closed

Description

@any626

I did what the wiki said, which is the following:

<?php
  putenv("webdriver.chrome.driver=/path/to/chromedriver");
  $driver = ChromeDriver::start();

But the browser never opens. I can see in the Activity Manager and terminal that it opens up but ends up timing out.

PHP Fatal error:  Uncaught exception 'Facebook\WebDriver\Exception\TimeOutException' with message 'Timed out waiting for http://localhost:9515/status to become available after 20000 ms.' in /Users/.../php/vendor/facebook/webdriver/lib/Net/URLChecker.php:36

I successfully ran the chromedriver using the same file in both node and python bindings.

Activity

  1. php-denken commented on May 21, 2016

    @php-denken

    Did you start a selenium server? Download it here http://www.seleniumhq.org/download/ (the 2.53.0 link) and start it with java -jar [downloaded file]. Java has to be installed on your machine.

  2. any626 commented on May 21, 2016

    @any626
    Author

    I didn't. The purpose of this is to run it without the server. Directly to the chrome driver.

  3. php-denken commented on May 21, 2016

    @php-denken

    Forget what I said. It is early in the morning and I didn't read your question well. I had not recognized that you are trying to run in without the server🤐

  4. added
    bug
    on Oct 12, 2016
  5. OndraM commented on Oct 14, 2016

    @OndraM
    Collaborator

    @php-denken Hi, do you still face the issue? As I was also not able to start the ChromeDriver directly, I've changed the way the standalone chrome driver is started. Could you please try using this branch to see if the issue lasts or not?

    Its in a branch in mine fork.

    If you change your composer.json to contain this:

    "repositories": [
        {
            "type": "vcs",
            "url": "https://github.com/OndraM/php-webdriver"
        }
    ]
    

    And then run
    composer require facebook/webdriver:dev-symfony-process@dev
    the updated version should be installed and you will be able to try it. Could you please test it?

  6. OndraM commented on Nov 2, 2016

    @OndraM
    Collaborator

    The way chrome processes are started was changed - please try in next php-webdriver and let us know if the problem persists!

  7. OndraM commented on Jan 14, 2017

    @OndraM
    Collaborator

    Should be fixed in php-webdriver 1.3.0.

  8. frankiejarrett commented on Jul 22, 2017

    @frankiejarrett

    @OndraM I'm experiencing the same problem described here. Possible regression?

    ChromeDriver 2.31.488774
    Facebook\WebDriver 1.4.1

    Test run.php bootstrap:

    <?php
    
    require __DIR__ . '/vendor/autoload.php';
    
    putenv('webdriver.chrome.driver=/path/to/chromedriver');
    
    $driver = Facebook\WebDriver\Chrome\ChromeDriver::start();

    Output:

    $ php run.php
    PHP Fatal error:  Uncaught Facebook\WebDriver\Exception\TimeOutException: Timed out waiting for http://localhost:9515/status to become available after 20000 ms. in /var/www/project/vendor/facebook/webdriver/lib/Net/URLChecker.php:37
    Stack trace:
    #0 /var/www/project/vendor/facebook/webdriver/lib/Remote/Service/DriverService.php(93): Facebook\WebDriver\Net\URLChecker->waitUntilAvailable(20000, 'http://localhos...')
    #1 /var/www/project/vendor/facebook/webdriver/lib/Remote/Service/DriverCommandExecutor.php(51): Facebook\WebDriver\Remote\Service\DriverService->start()
    #2 /var/www/project/vendor/facebook/webdriver/lib/Chrome/ChromeDriver.php(51): Facebook\WebDriver\Remote\Service\DriverCommandExecutor->execute(Object(Facebook\WebDriver\Remote\WebDriverCommand))
    #3 /var/www/project/vendor/facebook/webdriver/lib/Chrome/ChromeDriver.php(37): Facebook\WebDriver\Chrome\ChromeDriver->startSession(Object(Facebook\WebDriver\Rem in /var/www/project/vendor/facebook/webdriver/lib/Net/URLChecker.php on line 37
    
    Fatal error: Uncaught Facebook\WebDriver\Exception\TimeOutException: Timed out waiting for http://localhost:9515/status to become available after 20000 ms. in /var/www/project/vendor/facebook/webdriver/lib/Net/URLChecker.php on line 37
    
    Facebook\WebDriver\Exception\TimeOutException: Timed out waiting for http://localhost:9515/status to become available after 20000 ms. in /var/www/project/vendor/facebook/webdriver/lib/Net/URLChecker.php on line 37
    
    Call Stack:
        0.0002     355192   1. {main}() /var/www/project/run.php:0
        0.0028     500448   2. Facebook\WebDriver\Chrome\ChromeDriver::start() /var/www/project/run.php:7
        0.0060     676544   3. Facebook\WebDriver\Chrome\ChromeDriver->startSession() /var/www/project/vendor/facebook/webdriver/lib/Chrome/ChromeDriver.php:37
        0.0065     694056   4. Facebook\WebDriver\Remote\Service\DriverCommandExecutor->execute() /var/www/project/vendor/facebook/webdriver/lib/Chrome/ChromeDriver.php:51
        0.0065     694056   5. Facebook\WebDriver\Chrome\ChromeDriverService->start() /var/www/project/vendor/facebook/webdriver/lib/Remote/Service/DriverCommandExecutor.php:51
        0.0140    1076776   6. Facebook\WebDriver\Net\URLChecker->waitUntilAvailable() /var/www/project/vendor/facebook/webdriver/lib/Remote/Service/DriverService.php:93
    

    Response from http://localhost:9515/status:

    {
      "sessionId": "",
      "status": 0,
      "value": {
        "build": {
          "version": "alpha"
        },
        "os": {
          "arch": "x86_64",
          "name": "Mac OS X",
          "version": "10.12.6"
        }
      }
    }
  9. frankiejarrett commented on Jul 23, 2017

    @frankiejarrett

    So after a lot of digging I finally that discovered that PHP builds installed with Homebrew using the --with-homebrew-curl flag will not play nice with WebDriver.

    The problem went away after I ran this:

    brew unlink php71
    brew uninstall php71 --force --ignore-dependencies
    brew cleanup
    brew install php71
    
  10. OndraM commented on Jul 24, 2017

    @OndraM
    Collaborator

    @fjarrett Thanks for the information! Would be useful for others when facing the same issue :).

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

    bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions