microsoft / playwright-dotnet

.NET version of the Playwright testing and automation library.
https://playwright.dev/dotnet/
MIT License
2.5k stars 237 forks source link

[Bug]: Version `1.45` not working the same as version `1.44` #2964

Closed ady109 closed 3 months ago

ady109 commented 4 months ago

Version

1.45

Steps to reproduce

Example steps (replace with your own):

  1. Clone my repo: https://github.com/ady109/PlaywrightIssueRepro
  2. Using Visual Studio, Run the project F5
  3. Using version 1.45 you will see that you get an error message
  4. Using the previous version 1.44 you will see that it is successful

There are more details in the README.md file of the repo.

Expected behavior

I expect the repro code to show a validation error after submitting the form with fake username and password.

Actual behavior

The repro code shows an error on screen after the login form is posted, not the validation error details. There seems to be a difference between version 1.44 and 1.45 in the way the 3rd party web server handles the request, and I don't know what the difference is.

Additional context

You will need to update the package reference in the code to switch between version 1.44 and 1.45 to compare the differences.

Environment

- Operating System: Windows 1o
- CPU: Intel
- Browser: Firefox
- .NET Version (TFM): net8.0
- Other info:
mxschmitt commented 3 months ago

Starting from version v1.45 Firefox does also set the navigator.webdriver property to true. This aligns it how we do it with Chromium and WebKit. When I do the following experiment, it also doesn't work for me:

/Users/maxschmitt/Library/Caches/ms-playwright/chromium-1127/chrome-mac/Chromium.app/Contents/MacOS/Chromium --enable-automation --user-data-dir=foo

--enable-automation sets the navigator.webdriver property in Chromium. I recommend talking to your colleagues to remove this constrain / check / bot protection for automated end-to-end tests.

ady109 commented 3 months ago

The website I am automating is an external website so I'm not able to ask them to remove the constraint.

Is there a way I can force the navigator.webdriver property to false?

mxschmitt commented 3 months ago

There is unfortunately not. I'm closing this for now as working as intended.