Questions tagged [playwright-sharp]
56 questions
9
votes
3 answers
How can you get the selected option of a dropdown with Playwright
I am using the C# Language Bindings of Playwright.
Example HTML:

Andreas Willich
- 5,665
- 3
- 15
- 22
5
votes
2 answers
Cannot install playwright: Couldn't find project using Playwright. Ensure a project or a solution exists in
I'm trying to install playwright on my deployment target machine in order to run UI tests.
# Install the CLI once.
dotnet tool install --global Microsoft.Playwright.CLI
playwright install
however when using the playwright CLI including playwright…

Liero
- 25,216
- 29
- 151
- 297
5
votes
3 answers
Cannot run PlayWright inside docker image
I`m trying to create .net 5.0 docker image with playwright.
This is my DockerFile:
FROM mcr.microsoft.com/dotnet/runtime:5.0-buster-slim AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
WORKDIR /src
COPY…

Krzysztof
- 152
- 1
- 2
- 15
4
votes
1 answer
Playwright Wait for Page to completely load and XHR / Ajax Calls complete
I have previously used Puppeteer in Node.js and I am now using Microsoft.Playwright in .Net
I have a need to wait until all XHR / Ajax requests have finished so that the page is in a truly "ready" state. Using timouts and delays is unreliable.
With…

Martin Thompson
- 3,415
- 10
- 38
- 62
4
votes
1 answer
Playwright "Element is not attached to the DOM"
I am trying to scrape a website using Playwright (.NET). The website looks like it was written in the early 2000s (running in quirks mode and all), and I'm running into an issue that I can't seem to find a solution for.
My goal is to check a…

stellr42
- 3,365
- 2
- 21
- 33
4
votes
0 answers
Install Playwright on asp docker image
I have an Asp web api application using .net 5. The application is using Playwright to generate pdfs. It works locally on iis without any issues.
When I run it using docker windows containers on the following image:
FROM…

filip
- 1,444
- 1
- 20
- 40
4
votes
3 answers
How to use Playwright Sharp in F# for Browser Automation
I guess this is a classic C# to F# conversion I haven't quite got my head around.
I am trying to automate a browser using the quick start
https://playwright.dev/dotnet/docs/intro
The C# code is
using var playwright = await…

Martin Thompson
- 3,415
- 10
- 38
- 62
3
votes
1 answer
click on a link is not working in playwright
I'm trying to write a crawler for a specific website. At some point I have to click an link. The element is found but the click always fails. I also tried to it via the parent element with the same result. All other elements before can be accessed…

lichtbringer
- 125
- 1
- 1
- 10
2
votes
0 answers
Playwright & Accessing sessionStorage
I have an application that I want to test with some automated UI tests, where the devs have stored some of the user's preferences in the sessionStorage. There appears to be a bug where the session storage isn't getting cleared out when we expect it…

klreeher
- 1,391
- 2
- 15
- 27
2
votes
1 answer
Run Playwright.NET tests in Docker container
I have the following Dockerfile:
FROM mcr.microsoft.com/dotnet/runtime:5.0-buster-slim AS base
WORKDIR /app
FROM mcr.microsoft.com/dotnet/sdk:5.0-buster-slim AS build
WORKDIR /src
COPY ["PlaywrightSharp.csproj", "PlaywrightSharp/"]
RUN dotnet…

sarbo
- 1,661
- 6
- 21
- 26
2
votes
2 answers
Playwright (.NET) tries to use different browser versions than installed
I have created some tests using Playwright with .NET bindings.
[OneTimeSetUp]
public async Task OneTimeSetUp()
{
random = new Random();
var playwright = await Playwright.CreateAsync();
browser = await…

hubesal
- 141
- 3
- 13
2
votes
1 answer
Hot to debug playwright-dotnet tests with Microsoft.AspNetCore.TestHost
I'm trying to run Playwright locally by using debugging from xUnit and AspNetCore.TestHost and even if when I call the API endpoints the calls are successfully the SPA page is not loaded.
Are there any changes that I should do more to…

Mircea Mihai
- 167
- 1
- 13
2
votes
0 answers
Playwright not working in docker container of asp.net core application
I created a simple Asp.net core application and want to test playwright in my project. its is working fine in local Environment but when I am trying to deploy in docker container getting Error as Driver not found:…
2
votes
0 answers
Connect to existing browser using Playwright for .Net
We have a single Asp Core API method that is transforming provided html into PDF using headless Chromium. Currently the API method is using Puppeteer, which connects to an existing instance of Chromium using the debugging port and generates the PDF.…

filip
- 1,444
- 1
- 20
- 40
2
votes
1 answer
How to format HTML returned by Verify.PlayWright for better comparison
I am using Verify.PlayWright and to take HTML element snapshots. When the compare opens, all the HTML is on one line. This makes it hard to see the differences. Is there a way to format the HTML in order to get a nicer comparison?
var root = await…

Matthias Ploetz
- 23
- 3