1

i am trying to open firefox as the example explains herehttps://github.com/facebook/php-webdriver/blob/community/example.php with the following code:

<?php

namespace Facebook\WebDriver;  
use Facebook\WebDriver\Remote\DesiredCapabilities;
use Facebook\WebDriver\Remote\RemoteWebDriver;

require_once 'C:\Users\alex\vendor\autoload.php';


$host = 'http://localhost:44441/wd/hub'; // i am running on 44441
$capabilities = DesiredCapabilities::firefox();
$driver = RemoteWebDriver::create($host, $capabilities, 5000);
?>

my composer composer.json at \alex\vendor\ looks like this:

// autoload.php @generated by Composer

require_once __DIR__ . '/composer/autoload_real.php';

return ComposerAutoloaderInit95fa64adf2a94f75qbb05d3ee5a8af4e::getLoader();

my composer.json looks like this:

{
"require": {
    "facebook/graph-sdk": "^5.6"
}
}

and my error is:

PHP Fatal error:  Uncaught Error: Class 
'Facebook\WebDriver\Remote\DesiredCapabilities' not found in 
C:\Users\alex\Desktop\php-webdriver-community\hello.php:11
Stack trace: 
#0 {main}
thrown in C:\Users\akal\Desktop\php-webdriver-community\hello.php on line 11
[Finished in 0.0s]

can anyone help?

akalogiros
  • 75
  • 7

1 Answers1

0

To use the Facebook web driver, you need to install it using something like...

php composer.phar require facebook/webdriver

(From https://github.com/facebook/php-webdriver#installation ) In the project I use it, this includes a line in the composer.json...

"facebook/webdriver" : "^1.4"

and not the line you have with the graph-sdk

Nigel Ren
  • 56,122
  • 11
  • 43
  • 55