Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 5 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -71,10 +71,12 @@ BrowserStack Playwright tests in beta supports the following browsers across the

### Playwright versions supported

Currently, we are supporting 2 Playwright versions viz. `1.11.1` and `1.10.0`.
Playwright version can be specified using a capability as: `'browserstack.playwrightVersion': '1.10.0'`. If you do not specify a value for this capability then your tests would run on the default version `1.11.1`.
Currently, we are supporting 2 Playwright versions.
Playwright version can be specified using a capability for e.g.: `'browserstack.playwrightVersion': '1.12.3'`. If you do not specify a value for this capability then your tests would run on the latest version that is supported on the BrowserStack platform.

You can also pass the capability value as `'browserstack.playwrightVersion': '1.latest'` or `1.latest-1` to signify the 2 latest versions within the major version `1`. If you pass this capability, then you can be rest assured that whichever are the latest versions on BrowserStack, your tests would run on that without you needing to change your test code often.
We recommend you to pass the capability value as `'browserstack.playwrightVersion': '1.latest'` or `1.latest-1` to signify the 2 latest versions within the major version `1`. If you pass this capability, then you can be rest assured that whichever are the latest versions on BrowserStack, your tests would run on that without you needing to change your test code often.

You can learn more about the significance of selecting a Playwright version on the browser version in our [documentation](https://www.browserstack.com/docs/automate/playwright/browsers-and-os).

## Get Playwright session details

Expand Down
5 changes: 2 additions & 3 deletions sample_session_details_API.js
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,8 @@ const clientPlaywrightVersion = cp.execSync('npx playwright --version').toString
* You can use all these details after your test has completed, to fetch logs or use any other Automate REST APIs
*/
const resp = await JSON.parse(await page.evaluate(_ => {}, `browserstack_executor: ${JSON.stringify({action: 'getSessionDetails'})}`));
const jsonObj = await JSON.parse(resp);
console.log(jsonObj.hashed_id); // This gives the session ID of the running session
console.log(jsonObj); // This prints the entire JSON response. You can use any/all of the response attributes the way you like.
console.log(resp.hashed_id); // This gives the session ID of the running session
console.log(resp); // This prints the entire JSON response. You can use any/all of the response attributes the way you like.

await browser.close();
})();