2121 "os" : "OS X" ,
2222 "osVersion" : "Monterey" ,
2323 "buildName" : "browserstack-build-1" ,
24- "sessionName" : "BStack Python sample parallel" ,
24+ "sessionName" : "BStack parallel python " ,
2525 "browserName" : "chrome" ,
2626 "browserVersion" : "latest"
2727 },
2828 {
2929 "os" : "Windows" ,
3030 "osVersion" : "11" ,
3131 "buildName" : "browserstack-build-1" ,
32- "sessionName" : "BStack Python sample parallel" ,
32+ "sessionName" : "BStack parallel python " ,
3333 "browserName" : "firefox" ,
3434 "browserVersion" : "latest"
3535 },
3636 {
3737 "osVersion" : "10" ,
3838 "deviceName" : "Samsung Galaxy S20" ,
3939 "buildName" : "browserstack-build-1" ,
40- "sessionName" : "BStack Python sample parallel" ,
40+ "sessionName" : "BStack parallel python " ,
4141 "browserName" : "chrome" ,
4242 },
4343]
@@ -61,7 +61,7 @@ def run_session(cap):
6161 }
6262 if "os" in cap :
6363 bstack_options ["os" ] = cap ["os" ]
64-
64+ bstack_options [ "source" ] = "python:sample-main:v1.0"
6565 options = get_browser_option (cap ["browserName" ].lower ())
6666 if "browserVersion" in cap :
6767 options .browser_version = cap ["browserVersion" ]
@@ -90,14 +90,14 @@ def run_session(cap):
9090 # Set the status of test as 'passed' or 'failed' based on the condition; if item is added to cart
9191 driver .execute_script (
9292 'browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"passed", "reason": "iPhone 12 has been successfully added to the cart!"}}' )
93- except NoSuchElementException as err :
94- message = "Exception: " + str (err .__class__ ) + str (err .msg )
95- driver .execute_script (
96- 'browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"failed", "reason": ' + json .dumps (message ) + '}}' )
97- except Exception as err :
98- message = "Exception: " + str (err .__class__ ) + str (err .msg )
99- driver .execute_script (
100- 'browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"failed", "reason": ' + json .dumps (message ) + '}}' )
93+ except NoSuchElementException as err :
94+ message = "Exception: " + str (err .__class__ ) + str (err .msg )
95+ driver .execute_script (
96+ 'browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"failed", "reason": ' + json .dumps (message ) + '}}' )
97+ except Exception as err :
98+ message = "Exception: " + str (err .__class__ ) + str (err .msg )
99+ driver .execute_script (
100+ 'browserstack_executor: {"action": "setSessionStatus", "arguments": {"status":"failed", "reason": ' + json .dumps (message ) + '}}' )
101101 # Stop the driver
102102 driver .quit ()
103103
0 commit comments