Questions tagged [playwright-dotnet]

75 questions
1
vote
2 answers

When can Playwright's Page.ViewportSize be null?

The Page.ViewportSize property is defined as nullable. Under what conditions could it be null?
lonix
  • 14,255
  • 23
  • 85
  • 176
1
vote
2 answers

Change navigator.webdriver with Playwright

I'm using Playwright with Chrome. In other tools, one can easily change navigator.webdriver like so: Object.defineProperty(navigator, 'webdriver', { get: () => false }); In Playwright + Chrome (using .NET bindings, but same idea in Node / Python),…
lonix
  • 14,255
  • 23
  • 85
  • 176
1
vote
1 answer

Switch context to new page in Playwright (c#)

I want to create a method to Click on given element and open it in new tab. I manage to open new tab on click: public async Task ClickMenuItemNewTab(string menuItem, string section, string header) { var context =…
1
vote
1 answer

How to handle multiple file downloads in Playwright?

I have a button that when clicked will start downloading multiple files (this button will also open a chrome://downloads tab and closes it immediately. The page.download event handler for downloads will not fire. The page.WaitForDownloadAsync()…
1
vote
0 answers

Issue when Deploy Playwright PDF application on Azure App Service

I already deployed the app on the azure service but when run the Playwright operation that time got an error like this 2022-08-03 09:13:38.205 +00:00 [Error] Microsoft.AspNetCore.Diagnostics.ExceptionHandlerMiddleware: An unhandled exception has…
Akash Limbani
  • 1,283
  • 4
  • 14
  • 34
1
vote
1 answer

How to add author Name in extent report in C# for different authors of the test?

Can I add author name of the test to the extent report? I am using Playright with NUnit. I am using [Author] attribute of NUnit to write the author Name in the test case. //This is a test case [Test(Author="abc")] public async Task…
nike
  • 13
  • 2
1
vote
3 answers

How to maximize Chrome in Playwright using c# Nunit

Below code open Chrome in non maximised state. I can see the code online/youtube used in Java to change the screensize but not found anything for c#. public async Task Test1() { using var playwright = await…
1
vote
0 answers

PlayWright Wait for second response

after clicking the delete button on my page, that triggers the DELETE on server side, I do a GET if the response was successfull. How to I get the second response, which is GET-call from server, without any trigger event in PlayWright? var fetchUrl…
trap
  • 2,550
  • 7
  • 21
  • 42
1
vote
1 answer

Playwright - Locator for routerlink

there is a button in the page with the sintax below

Click the button below

1
vote
1 answer

Microsoft.Playwright.PlaywrightException : unable to verify the first certificate Using Playwright C# While connecting Moon

Trying with below code connecting Moon. Can someone please help me on this? Microsoft.Playwright.PlaywrightException: unable to verify the first certificate Using Playwright Strack Trace: onnection.SendMessageToServerAsync[T](String guid, String…
0
votes
0 answers

Sudden problem with Playwright on Chrome?

I had some code that was previously (like a week ago) working that hasn't changed, but the system under test has and I've upgraded Chrome. Now sometimes when I execute ScrollIntoViewIfNeeded the first one seems to work, but later calls to it do…
Drew Delano
  • 1,421
  • 16
  • 21
0
votes
0 answers

Is there any possible way to hide and show browser via Playwright?

I want to use this as setting for my app. Browser needs to be hidden or shown depending on checkbox value. I know that there is headless mode, but is there any way to this dynamically without instance recreating? I thought that I could use an old…
Bannyk
  • 1
  • 1
0
votes
0 answers

How to access page in AfterTestRun hook

I want to create after test run rook to clean data after run. For AfterScenario hooks I'm using ScenarioContext from injection: public Hooks(ScenarioContext scenarioContext) { _scenarioContext = scenarioContext; } later I can call Pages inside…
laxsore
  • 143
  • 1
  • 2
  • 9
0
votes
1 answer

Unable to click on any element using GetByText

I am using playwright with c# .net. When I tried to click on element using getByRole or xpath, It is working fine. When I tried using getByText or getByTitle neither it is giving error nor it is clicking on it. Please see attached image. I want to…
0
votes
1 answer

Playwright .NET NUnit: Locating nested checkbox within divs

In my PlayWright application (.NET within NUnit). I am trying to tick the 'Yes' box of Question 2 below Here's my code: await page .Locator("div").Filter(new() { HasText = "Question 2 (Help find me and tick yes)" }) …
sam.tldr
  • 65
  • 3
  • 9