11

Im using SauceLabs and I need the sessionId to get the Job Id there and use it to set pass/fail status during execution of the test. How can I get the session Id using python?

Gus
  • 573
  • 1
  • 5
  • 18
  • Just doing a cursory glance over at google, I found [this](http://webpython.codepoint.net/cgi_session) that might help you. Of course, if it doesn't... then I'm a jerk, and I apologize. – QuestionMarcs Nov 13 '13 at 03:36
  • Yep, that's not what I'm looking for. Thanks though – Gus Nov 13 '13 at 13:34

3 Answers3

19

Found it!

The value of the Selenium Remote Webdriver sessionId can be retrieved by

self.driver.session_id

That value is used on SauceLabs to identify the Jobs (Job ID)

Gus
  • 573
  • 1
  • 5
  • 18
0

"driver.session_id" will get you the session-id of current session.

Nidhisha
  • 1
  • 1
0

This worked for me:

BuiltIn().get_library_instance('SeleniumLibrary').driver.session_id

Chunter4
  • 85
  • 1
  • 1
  • 5