You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
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
The text was updated successfully, but these errors were encountered:
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
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 issue reported on code.google.com by
[email protected]
on 13 Jan 2015 at 4:28The text was updated successfully, but these errors were encountered: