-
Notifications
You must be signed in to change notification settings - Fork 43
added get session details sample scripts #20
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
catch (Exception err) { | ||
await MarkTestStatus("failed", err.Message, page); | ||
} | ||
Object sessionObject = await page.EvaluateAsync("_ => {}", "browserstack_executor: {\"action\":\"getSessionDetails\"}"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This will come after else block. If page is destroyed and comes in catch block and post which we try to getSessionDetails it will throw error.
Browser browser = chromium.connect(ws_endpoint); | ||
BrowserContext context = browser.newContext(new Browser.NewContextOptions() | ||
.setUserAgent("Mozilla/5.0 (Linux; Android 11; Pixel 5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/101.0.4943.0 Mobile Safari/537.36") | ||
.setViewportSize(393, 727) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we fetch this viewport from devices json based on device name?
mark_test_status("failed", str(err), page) | ||
|
||
# get details of the session | ||
response = page.evaluate("_=> {}", 'browserstack_executor: {"action": "getSessionDetails"}') |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This should be before except block
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
No description provided.