3

I have a selenium-server-standalone-2.42.2.jar running on my ubuntu system with firefox 35 version. I am using phpwebdriver.As I run my Selenium script it open up the firefox browser and ends there. My script is:

<?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();

?>

When I run this script it opens the firefox and stops there and at last it throws me this error. I don't know how to resolve it.

stdClass Object
(
    [status] => 13
    [sessionId] => 
    [value] => stdClass Object
        (
            [message] => POST /session//element
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'
System info: host: 'zaptech', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.2.0-27-generic', java.version: '1.7.0_121'
Driver info: driver.version: unknown
            [localizedMessage] => POST /session//element
Build info: version: '2.42.2', revision: '6a6995d', time: '2014-06-03 17:42:03'
System info: host: 'zaptech', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.2.0-27-generic', java.version: '1.7.0_121'
Driver info: driver.version: unknown
            [suppressed] => Array
                (
                )

            [cause] => 
            [supportUrl] => 
            [systemInformation] => System info: host: 'zaptech', ip: '127.0.1.1', os.name: 'Linux', os.arch: 'amd64', os.version: '4.2.0-27-generic', java.version: '1.7.0_121'
            [class] => org.openqa.selenium.UnsupportedCommandException
            [additionalInformation] => 
Driver info: driver.version: unknown
            [hCode] => 1436132011
            [stackTrace] => Array
                (
                    [0] => 
                    [1] => 
                    [2] => 
                    [3] => 
                    [4] => 
                    [5] => 
                    [6] => 
                    [7] => 
                    [8] => 
                    [9] => 
                    [10] => 
                    [11] => 
                    [12] => 
                    [13] => 
                    [14] => 
                    [15] => 
                    [16] => 
                    [17] => 
                    [18] => 
                )

        )

    [state] => unhandled error
    [class] => org.openqa.selenium.remote.Response
    [hCode] => 1502000244
)
PHP Fatal error:  Uncaught exception 'WebDriverException' with message '13' in /var/www/html/selenium/wdtest/phpwebdriver/WebDriverBase.php:130
Stack trace:
#0 /var/www/html/selenium/wdtest/phpwebdriver/WebDriverBase.php(170): WebDriverBase->handleResponse(Object(stdClass))
#1 /var/www/html/selenium/wdtest/index.php(24): WebDriverBase->findElementBy('name', 'q')
#2 {main}
  thrown in /var/www/html/selenium/wdtest/phpwebdriver/WebDriverBase.php on line 130

What I am missing like? Or Maybe browser compatibilty issues?

  • Show your code where you set the firefox driver path to selenium. – John Joseph Jan 06 '17 at 09:51
  • Like I have downloaded phpwebdriver dependencies thats it! I haven't installed firefox driver so Like what shall I do now? according to you? –  Jan 06 '17 at 09:54
  • You may need to downgrade firefox (or upgrade the selenium driver). See here: http://stackoverflow.com/questions/24502927/is-selenium-2-42-2-webdriver-compatible-with-firefox-27-0-1 – John Joseph Jan 06 '17 at 09:57
  • I have followed that link for my reference so like I am using version 35 I still have to go downgrade for firefox? –  Jan 06 '17 at 09:59
  • If you see the answer in that question, you'll see that 2.42.2 only supports up to FF 29. See the changelog here: https://github.com/SeleniumHQ/selenium/blob/master/java/CHANGELOG – John Joseph Jan 06 '17 at 10:00
  • Lets see I am now like downgrading again firefox and see will it work there? are you sure? –  Jan 06 '17 at 10:02
  • also here, although it's out of date for versions after 2.45 https://github.com/santiycr/selenium-firefox-support-matrix – John Joseph Jan 06 '17 at 10:02
  • You're better off updating selenium if you can to the latest 2.x branch (2.5.3 is the last) as that will support later browser versions. Upgrading to selenium 3.x is a bit different as it's been refactored a lot. – John Joseph Jan 06 '17 at 10:07

1 Answers1

-1

i had the same problem while running tests on Firefox. browser has opened but unable to locate the URL in browser and given error. tried many ways but no help. finally i added all the jar files to library as how we do in eclipse using build path > libraries.

it is working fine and I'm able to run my tests. using Firefox 35. Also upgrade your selenimum jar file version to (2.45).

Hope it helps!!!

prakash tank
  • 1,269
  • 1
  • 9
  • 15