How to get sessionId browser using Selenium webdriver

I am using selenium webdriver (extension yii php-webdriver-bindings) and I am trying to get sessionId browser (the one that will be used for testing). I thought I could get this through a webdriver, but it doesn't seem to be that way. Webdriver has a sessionId, but it is not the one that uses the test browser.

I am trying to log in before starting the test so that my tests are an authenticated user, which will allow them to access the pages that I am testing.

I studied and tested this for several days, and I am at a loss. Any help would be greatly appreciated.

Thank.

+5
source share
3 answers

, . RemoteWebDriver, , getSessionId:

((RemoteWebDriver) driver).getSessionId()
+5

Java, , WebDriver. RemoteWebDriver .getSessionId(), driver.getSessionId() , .

, PHP, , RemoteWebDriver, WebDriver.

0

: : stdClass :: $ sessionId C:\xampp\htdocs\wbtest\phpwebdriver\WebDriver.php 60 stdClass ([sessionId] => [value] => stdClass ([error] => ) ID [] => [stacktrace] =>) [status] => 6) : Uncaught WebDriverException: 6 C:\xampp\htdocs\wbtest\phpwebdriver\WebDriverBase.php: 130 Stack : # 0 C:\xampp\htdocs\wbtest\phpwebdriver\WebDriverBase.php(170): WebDriverBase-> handleResponse (Object (stdClass)) # 1 C:\xampp\htdocs\wbtest\example.php(24): WebDriverBase-> findElementBy ('name', 'q') # 2 {main}, C:\xampp\htdocs\wbtest\phpwebdriver\WebDriverBase.php 130

0

All Articles