Good afternoon, I'm having a bug in a selenium class. Does anyone know how to solve it? the code snippet is this.
/* new way to retrieve sessionId from response in selenium 2.35.0 */
list($headers, $content) = explode("\r\n\r\n", $rawResponse, 2);
$jsonResponse = json_decode($content);
$sessionId = $jsonResponse->{'sessionId'};
$this->requestURL = $header['url'].'/'.$sessionId;
//print_r($this->requestURL);
Code I want to use
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();
This code is 2013, I think with the selenium updates this part has become obsolete.