File tree Expand file tree Collapse file tree 2 files changed +24
-24
lines changed Expand file tree Collapse file tree 2 files changed +24
-24
lines changed Original file line number Diff line number Diff line change @@ -40,25 +40,24 @@ public static async Task main(string[] args)
40
40
{
41
41
await MarkTestStatus ( "failed" , "Title did not match" , page ) ;
42
42
}
43
+ Object sessionObject = await page . EvaluateAsync ( "_ => {}" , "browserstack_executor: {\" action\" :\" getSessionDetails\" }" ) ;
44
+ Console . WriteLine ( sessionObject ) ;
45
+
46
+ // convert Object to String for parsing
47
+ string ? json_resp = Convert . ToString ( sessionObject ) ;
48
+
49
+ // parse the data
50
+ if ( json_resp != null )
51
+ {
52
+ var session_details = JObject . Parse ( json_resp ) ;
53
+
54
+ // print the session ID on IDE's console
55
+ Console . WriteLine ( session_details [ "hashed_id" ] ) ;
56
+ }
43
57
}
44
58
catch ( Exception err ) {
45
59
await MarkTestStatus ( "failed" , err . Message , page ) ;
46
60
}
47
- Object sessionObject = await page . EvaluateAsync ( "_ => {}" , "browserstack_executor: {\" action\" :\" getSessionDetails\" }" ) ;
48
- Console . WriteLine ( sessionObject ) ;
49
-
50
- // convert Object to String for parsing
51
- string ? json_resp = Convert . ToString ( sessionObject ) ;
52
-
53
- // parse the data
54
- if ( json_resp != null )
55
- {
56
- var session_details = JObject . Parse ( json_resp ) ;
57
-
58
- // print the session ID on IDE's console
59
- Console . WriteLine ( session_details [ "hashed_id" ] ) ;
60
- }
61
-
62
61
await browser . CloseAsync ( ) ;
63
62
}
64
63
Original file line number Diff line number Diff line change @@ -29,18 +29,19 @@ def run_session(playwright):
29
29
mark_test_status ("passed" , "Title matched" , page )
30
30
else :
31
31
mark_test_status ("failed" , "Title did not match" , page )
32
+
33
+ # get details of the session
34
+ response = page .evaluate ("_=> {}" , 'browserstack_executor: {"action": "getSessionDetails"}' )
35
+ print (response )
36
+
37
+ jsonResponse = json .loads (response )
38
+
39
+ # print the session ID in the IDE's console
40
+ print (jsonResponse ["hashed_id" ])
41
+
32
42
except Exception as err :
33
43
mark_test_status ("failed" , str (err ), page )
34
44
35
- # get details of the session
36
- response = page .evaluate ("_=> {}" , 'browserstack_executor: {"action": "getSessionDetails"}' )
37
- print (response )
38
-
39
- jsonResponse = json .loads (response )
40
-
41
- # print the session ID in the IDE's console
42
- print (jsonResponse ["hashed_id" ])
43
-
44
45
browser .close ()
45
46
46
47
def mark_test_status (status , reason , page ):
You can’t perform that action at this time.
0 commit comments