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

Unable to run this library. #40

Open
GoogleCodeExporter opened this issue Aug 27, 2015 · 2 comments
Open

Unable to run this library. #40

GoogleCodeExporter opened this issue Aug 27, 2015 · 2 comments

Comments

@GoogleCodeExporter
Copy link

I download the library today and try to run it but instead of the successful 
running I got the following errors

The result I got for example.php in the library.

Notice: Undefined offset: 1 in 
C:\xampp\htdocs\PHPSELENIUM\phpwebdriver\WebDriver.php on line 58

Notice: Trying to get property of non-object in 
C:\xampp\htdocs\PHPSELENIUM\phpwebdriver\WebDriver.php on line 60

here is my example code

<?php
require_once "phpwebdriver/WebDriver.php";

$webdriver = new WebDriver("localhost", "4444");
$webdriver->connect("firefox");                            
$webdriver->get("http://google.com");
$element = $webdriver->findElementBy(LocatorStrategy::name, "q");
if ($element) {
    $element->sendKeys(array("php webdriver" ) );
    $element->submit();
}

$webdriver->close();
?>

Original issue reported on code.google.com by [email protected] on 13 Jan 2015 at 4:28

@GoogleCodeExporter
Copy link
Author

I changed my xampp server port to 8080 instead of 80. So when I change above 
code to the following code

<?php
require_once "phpwebdriver/WebDriver.php";

$webdriver = new WebDriver("localhost", "8080");
$webdriver->connect("firefox");                            
$webdriver->get("http://google.com");
$element = $webdriver->findElementBy(LocatorStrategy::name, "q");
if ($element) {
    $element->sendKeys(array("php webdriver" ) );
    $element->submit();
}

$webdriver->close();
?>


then I face the following error.

Notice: Trying to get property of non-object in 
C:\xampp\htdocs\PHPSELENIUM\phpwebdriver\WebDriver.php on line 60

Original comment by [email protected] on 13 Jan 2015 at 4:36

@GoogleCodeExporter
Copy link
Author

Sounds like you are confusing how to connect the PHP webdriver? You don't need 
to use XAMPP or any web server for this library. Just PHP binary whether it's 
standalone or installed with XAMP or other web server package.

You do however need to start up the Selenium Server JAR (i.e. for 
RemoteWebDriver, or start it up for Selenium Grid mode of a hub and a node). 
Then you connect to the Selenium Server that was started. By default it is port 
4444 and you run it on the same localhost. However you can run it on a remote 
machine or use a different port with Selenium Server startup command line (or 
config file) options.

Original comment by [email protected] on 27 Apr 2015 at 3:37

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

No branches or pull requests

1 participant