Skip to main content
7 votes
Accepted

Playwright: Printing Console Logs each time when one of the test fails

Browser console message/errors can be listened like below at runtime: const playwright = require("playwright"); (async () => { const browser = await playwright.chromium.launch(); ...
Vishal Aggarwal's user avatar
4 votes
Accepted

Playwright: Storing an element selector in variable

const playwright = require('playwright'); (async () => { const browser = await playwright["chromium"].launch({ headless: false}); const context = await browser.newContext(); ...
PDHide's user avatar
  • 11.1k
4 votes
Accepted

Test users password- static or dynamic

I would recommend taking a step back from the technical implementation of generating password values and consider what are the specific risks you're trying to mitigate with these end-to-end tests. Is ...
Andrew January's user avatar
3 votes
Accepted

Passing the UI data from one test to another

One test. Two setup steps. What you have described is very common, particularly as test scenarios get more complex. What you need is one test with setup that does the user logging in, the user ...
Michael Durrant's user avatar
3 votes
Accepted

Playwright: Executing different test suites depending on script parameter

That depends on what exactly you use. Playwright could be used with jest, mocha, ... Some examples with mocha: package.json: "scripts": { "smoke-test": "mocha tests/smoke-...
pavelsaman's user avatar
  • 4,548
2 votes
Accepted

Playwright: Working with Bootstrap modal dialogs/popups

After long testing, debugging and with little bit of help I was able to find the solution. As a starter I used all possible Plawright debugger which you can find in here https://playwright.dev/docs/...
Automation_Padawan's user avatar
2 votes
Accepted

Playwright: Creating and interacting with a list of elements on the page

const myItemList = await this.page.$$('tr[class="ant-table-row-0"]'); const myGroupItems = await myItemList.$$('tr:has-text("My Group Value")'); $$ returns a list, not an object, ...
PDHide's user avatar
  • 11.1k
2 votes

Passing the UI data from one test to another

It's an single integration test. First of all it has nothing to do with playwright, it's common automation scenario which can occur while using any automation library/frameworks. I have faced this ...
Vishal Aggarwal's user avatar
2 votes
Accepted

Playwright vs Selenium

Oh, the "newness" argument. Well, that's technology; we are a sector of newness. Anyway, to help with the newness argument, Playwright isn't exactly "new." What do I mean by this? ...
Lee Jensen's user avatar
  • 2,196
2 votes
Accepted

Page Object Model - Locators as functions vs constructor?

In the second case, the locator objects are created every time it is called/used. When the LoginPage object is created, nothing related to the locator is executed. In the first case, when the ...
João Farias's user avatar
  • 10.9k
1 vote

Playwright: expect.toHaveAttribute: Unsupported token "@xpath" while parsing selector

You should use ideally toHaveTitle await expect(page).toHaveTitle(/.*titleTextORregularExpression/); Reference: https://playwright.dev/docs/api/class-pageassertions#page-assertions-to-have-title
Vishal Aggarwal's user avatar
1 vote

Playwright vs Selenium

Playwright is rapidly gaining acceptance and becoming industry standard. I have seen Playwright listed in job ads but have not seen mentions in any resumes yet. Keep in mind that the ability to ...
ToastMan's user avatar
  • 390
1 vote

Playwright vs Selenium

I recently migrated an automation suite of 5000+ tests from Protractor(Selenium) to Playwright succesfully , below are my few insights: Reduced execution time from 10 hrs to 1.5 to 2 hrs (5 times) ...
Vishal Aggarwal's user avatar
1 vote

Playwright vs Selenium

I am not fully sure what kind of arguments may be important, but let us give it a try: I know that the speed is not the most important thing, but sometimes it can be taken into account. Playwright may ...
Daniel Delimata's user avatar
1 vote

Will Selenium Webdriver become less popular in coming years?

Realistically if you analyse this change of inclusion of new framework & compare with older one, following points will have to be taken into consideration: New frameworks like Cypress, ...
Narendra Chandratre's user avatar
1 vote

How can I run test cases implementing Pytest, Playwright and Gherkin Features with Python?

The issue is that there is no test function defined in your implementation file, which is required by Pytest to identify what to run. To fix this, add a test function in the implementation file: from ...
IAmMilinPatel's user avatar
1 vote

Is there any way to import postman collection into playwright?

There is no direct way to import Postman collections into Playwright. However, you can export the Postman collections as a JSON file and write a script to convert the data into Playwright test scripts....
IAmMilinPatel's user avatar
1 vote

Is there any way to import postman collection into playwright?

For Playwright... there is no import tool that I know of. One option is to import Postman collections into ReadyAPI. It is not a perfect process, as some data will be missing and you will need to ...
ToastMan's user avatar
  • 390
1 vote
Accepted

Playwright: Using ReqExp inside of the URL while trying to check PUT request via page.waitForResponse()

There are 2 mistakes as far as I can see: 1/ strictly comparing a string object with a different object (re) will always return false: You need to use some method like RegExp.prototype.test(), for ...
pavelsaman's user avatar
  • 4,548

Only top scored, non community-wiki answers of a minimum length are eligible