Oh, I didn't know this existed. Definitely going to try this. I'm currently using Puppeteer Sharp ( https://github.com/hardkoded/puppeteer-sharp ) and something like: > await page.GotoAsync(" https://playwright.dev/dotnet "); > await page.ScreenshotAsync(new PageScreenshotOptions() { Path = "screenshot.png" }); Is broken, if you have background images in CSS the screenshot happens after Page Load is completed but bef…
Playwright for .NET is now stable
11–20 of 66 posts
Re: Playwright for .NET is now stable
#12Oh, I didn't know this existed. Definitely going to try this. I'm currently using Puppeteer Sharp ( https://github.com/hardkoded/puppeteer-sharp ) and something like: > await page.GotoAsync(" https://playwright.dev/dotnet "); > await page.ScreenshotAsync(new PageScreenshotOptions() { Path = "screenshot.png" }); Is broken, if you have background images in CSS the screenshot happens after Page Load is completed but bef…
Have you tried selinium and phantomjs headless ? I was using that a few years ago and it worked very well.
Re: Playwright for .NET is now stable
#13Does 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.
If you want to get a sense of how far the system can scale, you would be better with a proper performance testing framework that can run multiple threads, ideally from multiple locations (to avoid any network limits) and built-in support for accurate timing. Apache Bench is pretty common and relatively easy to setup and use. There is also JMeter and even SaaS services to do it for you.
Re: Playwright for .NET is now stable
#14Oh, I didn't know this existed. Definitely going to try this. I'm currently using Puppeteer Sharp ( https://github.com/hardkoded/puppeteer-sharp ) and something like: > await page.GotoAsync(" https://playwright.dev/dotnet "); > await page.ScreenshotAsync(new PageScreenshotOptions() { Path = "screenshot.png" }); Is broken, if you have background images in CSS the screenshot happens after Page Load is completed but bef…
Same guy does playwright sharp, he should really have more supporters
Re: Playwright for .NET is now stable
#15really curious about peoples experience with this compared to things like Cypress.
I've had some issues with Cypress selectors randomly failing to find matching elements, even though they are clearly present. Like if I run the same script 10 times it goes through ~7 times. I wanted to try Playwright for another application to avoid such issues. And then I was very surprised to get almost the exact same issues with Playwright. Running against a different application with different test cases. Has an…
Re: Playwright for .NET is now stable
#16Oh, I didn't know this existed. Definitely going to try this. I'm currently using Puppeteer Sharp ( https://github.com/hardkoded/puppeteer-sharp ) and something like: > await page.GotoAsync(" https://playwright.dev/dotnet "); > await page.ScreenshotAsync(new PageScreenshotOptions() { Path = "screenshot.png" }); Is broken, if you have background images in CSS the screenshot happens after Page Load is completed but bef…
Have you tried selinium and phantomjs headless ? I was using that a few years ago and it worked very well.
Selenium is a source of constant bugs and misery - it's truly a waste of time maintaining its usage in a codebase because randomly sometimes tests fail. The C# wrapper for it is even worse, as it does not follow the idioms of C# and is a straight 1:1 port from the Java version. Highlights include getting exceptions from properties when you hover over them during debug in Visual Studio.
Re: Playwright for .NET is now stable
#17really curious about peoples experience with this compared to things like Cypress.
I've had some issues with Cypress selectors randomly failing to find matching elements, even though they are clearly present. Like if I run the same script 10 times it goes through ~7 times. I wanted to try Playwright for another application to avoid such issues. And then I was very surprised to get almost the exact same issues with Playwright. Running against a different application with different test cases. Has an…
Re: Playwright for .NET is now stable
#18Earlier quoted context omitted.
Have you tried selinium and phantomjs headless ? I was using that a few years ago and it worked very well.
PhtantomJS was abandoned officially a long time ago because of all these new and better tools. Selenium is a source of constant bugs and misery - it's truly a waste of time maintaining its usage in a codebase because randomly sometimes tests fail. The C# wrapper for it is even worse, as it does not follow the idioms of C# and is a straight 1:1 port from the Java version. Highlights include getting exceptions from pro…
rerunning tests because always a few of them fail on first run
but I noticed that the biggest reason was that often my browser was a little ahead when it comes to version than engine, and after updating both of them the situation was a kinda better.
Anyway I don't recommend Selenium, it wastes too much time
Re: Playwright for .NET is now stable
#19Earlier quoted context omitted.
Have you tried selinium and phantomjs headless ? I was using that a few years ago and it worked very well.
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.
#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-stable_current_amd64.deb
RUN rm google-chrome-stable_current_amd64.deb
ENV PUPPETEER_SKIP_CHROMIUM_DOWNLOAD=true
ENV PUPPETEER_EXECUTABLE_PATH=/usr/bin/google-chrome-stable
browser = await Puppeteer.LaunchAsync(
new LaunchOptions {
//If we're debugging, then open actual chrome:
Headless = !Debugger.IsAttached,
Args = new string[] {
"--no-sandbox"
},
});Re: Playwright for .NET is now stable
#20Oh, I didn't know this existed. Definitely going to try this. I'm currently using Puppeteer Sharp ( https://github.com/hardkoded/puppeteer-sharp ) and something like: > await page.GotoAsync(" https://playwright.dev/dotnet "); > await page.ScreenshotAsync(new PageScreenshotOptions() { Path = "screenshot.png" }); Is broken, if you have background images in CSS the screenshot happens after Page Load is completed but bef…
It's an amazing piece of software for a domain that was kept on the side of the road for years.
If you already tried Cypress, then it's Cypress but with true multiple browser support, available in 4 languages, without the bloat and a cleaner and more idiomatic API.