Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Change browser name programmatically / run test across multiple browsers in NUnit #2938

Closed
1 task done
hayters opened this issue May 21, 2024 · 4 comments
Closed
1 task done

Comments

@hayters
Copy link

hayters commented May 21, 2024

Please do not submit this issue.

  • I understand
@mxschmitt
Copy link
Member

This issue is not following the bug template. Please re-file and provide a self-contained reproduction, which we can run locally to reproduce your issue. Thanks for your understanding!

@hayters
Copy link
Author

hayters commented May 21, 2024

I've been evaluating Playwright.NET with the NUnit test runner, and am curious if there is a way to execute tests across multiple browsers?

Is there any way of running the tests across multiple browsers from within the C# tests? I've been looking at using the TestFixture attribute with the browser names, but there isn't any way (or at least not an obvious way) to set the browser name programmically from within the test.

(I know I can go up a level and run the tests multiple times and pass settings in, but was curious if there was a way of controlling this from within the C#)

@mxschmitt
Copy link
Member

mxschmitt commented May 21, 2024

We recommend the same browser per the whole test-execution. If you still need a different browser, you can launch it manually: https://playwright.dev/dotnet/docs/api/class-browsertype#browser-type-launch inside your test, using the Playwright class property.

Running all the tests in multiple browsers is not possible as of today.

@hayters
Copy link
Author

hayters commented May 21, 2024

Thank you @mxschmitt for the clarification :).

This issue was closed.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants