Live data from Hacker News

Playwright for .NET is now stable

github.com

21–30 of 66 posts

Re: Playwright for .NET is now stable

#21
post #8

Does anyone know if this can be used for effective performance testing? It’s not clear from the Playwright documentation, but I know Selenium (a similar tool) does not recommend performance testing.

We use both Testim.io and Playwright for performance testing.

I work at Microsoft but at a completely unrelated team and while I know some of the folks who work on playwright I have no official affiliation and my opinions represent my own and not my employer's.

Playwright is great for this sort of thing! All we do is run the same test with two variants (before/after the change) and run a student t-test (well, a welch t-test but close enough).

It's ±50 LoC and as long as you're fine with running the test enough times to get statistical significance Playwright works quite well for this

Re: Playwright for .NET is now stable

#22
post #6
post #3

really curious about peoples experience with this compared to things like Cypress.

This question does come up quite a lot. One thing the remember is that Cypress is "batteries included" testing framework, where Playwright is essentially just the browser automation part of it. I know the Playwright team is "moving up the stack" and adding many specific testing features, but it's not at the same level (yet?) as Cypress.

I think you're thinking of Puppeteer? Playwright has stuff like automatically waiting for elements, selecting by text etc all built in - with modern JavaScript/TypeScript, none of the weird chaining syntax and debugger.

There are also tools that give you pretty much any feature Cypress has on top of Playwright.

(Not saying which is better - only that they're both sort of the same slot)

Re: Playwright for .NET is now stable

#23
post #7

Pair Playwright with Robot Framework ( https://github.com/MarketSquare/robotframework-browser ) and you'll get awesome browser automation with solid reporting, good test instrumentation and support for pretty much any TA need you might have besides browser automation.

Playwright is fantastic, but having used a lot Robot Framework in the past, I would not recommend it even to my worst enemy. The experience he continuous from string / to string conversions that you need to do with the content of the steps and the orrible structure of the directories and the amount of glue code to share some common methods around, brought me to don't even take into consideration job offers that have "Robot Framework" in them.

Re: Playwright for .NET is now stable

#24
post #13
post #8

Does anyone know if this can be used for effective performance testing? It’s not clear from the Playwright documentation, but I know Selenium (a similar tool) does not recommend performance testing.

It depends exactly what you mean by performance testing. The problem with a lot of UI tests is that you might need to add artificial slowness to make the tests more likely to pass. Even waiting for something to appear can take longer than it would in a browser. If you want a basic number to see regression, sure you can use this. If you want to get a sense of how far the system can scale, you would be better with a pr…

> The problem with a lot of UI tests is that you might need to add artificial slowness to make the tests more likely to pass.

For most real-world performance tests, you should be adding plenty of delay. The average delay on the web between pages for real users runs around 50 seconds, last I looked (which was a while ago, admittedly).

If your app uses keepalives, or polling, or websockets, running your users really fast is going to make your test less accurate and you may get a false positive.

Re: Playwright for .NET is now stable

#26

Earlier quoted context omitted.

I couldn't get it working in an AWS Lambda. May work now but I haven't had time this year to re-visit that project.

Assuming those run a container? With puppeteer on Heroku, I had to install chrome as part of the container, then pass it no-sandbox on startup. I'd guess you'd need something similar with chrome (I'm on mobile, so excuse the formatting): #Install Chrome for Puppeteer: RUN curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb RUN apt-get update -y RUN apt-get install -y ./google-chrome-sta…

I can run puppeteer in a Lambda fine, it's just that when you navigate to a webpage with a background loaded as a css image it doesn't wait for that to load before taking the screen grab. :(

https://github.com/puppeteer/puppeteer/issues/4046

Re: Playwright for .NET is now stable

#28
post #9
post #3

really curious about peoples experience with this compared to things like Cypress.

Well, Cypress is going to use playwright for their Webkit integration. Cypress is more limited compared to Playwright such as multi-domains aren't supported, multiple tabs, or popup windows. For my tests that require that I am using Playwright and for the rest I am currently using Cypress. But I do think the test writing experience is better with Cypress :) I am considering to move to Playwright for everything now wi…

> such as multi-domains aren't supported

Thankfully this is being actively worked on: https://github.com/cypress-io/cypress/issues/944#issuecommen...

Re: Playwright for .NET is now stable

#29
post #7

Pair Playwright with Robot Framework ( https://github.com/MarketSquare/robotframework-browser ) and you'll get awesome browser automation with solid reporting, good test instrumentation and support for pretty much any TA need you might have besides browser automation.

Playwright is fantastic, but having used a lot Robot Framework in the past, I would not recommend it even to my worst enemy. The experience he continuous from string / to string conversions that you need to do with the content of the steps and the orrible structure of the directories and the amount of glue code to share some common methods around, brought me to don't even take into consideration job offers that have…

RF does automatic type conversion based on the typehints in the python libraries used. So no need to change types manually. And there is no dictated directory structure. So, stop doing horrible directory structures and the pain goes away. And there is no glue at all needed to share methods at all. Write function in Python/keyword in Robot framework and take it in use using "Resource" or "Library" statement. Done.
Post reply on HN