Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

How do we parameterize the tests in SeleniumBase #938

Answered by mdmintz
Kumaravasanth asked this question in Q&A
Discussion options

Can we use the pytest fixtures to parameterize the tests created using SeleniumBase? Please share if there are any examples for the same.

You must be logged in to vote

There are two ways to parameterize SeleniumBase tests:

  • With the parameterized library.
  • With pytest.mark.parametrize.

Here's an example of using parameterized: https://github.com/seleniumbase/SeleniumBase/blob/master/examples/parameterized_test.py

Here's an example of using pytest.mark.parametrize:
https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_pytest_parametrize.py

You'll notice that in order to use pytest.mark.parametrize, you'll need to use SeleniumBase as a pytest fixture. That's one of the syntax formats of SeleniumBase. (See https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md for the full list of SeleniumBase syntax formats.)

Replies: 1 comment

Comment options

There are two ways to parameterize SeleniumBase tests:

  • With the parameterized library.
  • With pytest.mark.parametrize.

Here's an example of using parameterized: https://github.com/seleniumbase/SeleniumBase/blob/master/examples/parameterized_test.py

Here's an example of using pytest.mark.parametrize:
https://github.com/seleniumbase/SeleniumBase/blob/master/examples/test_pytest_parametrize.py

You'll notice that in order to use pytest.mark.parametrize, you'll need to use SeleniumBase as a pytest fixture. That's one of the syntax formats of SeleniumBase. (See https://github.com/seleniumbase/SeleniumBase/blob/master/help_docs/syntax_formats.md for the full list of SeleniumBase syntax formats.)

You must be logged in to vote
0 replies
Answer selected by mdmintz
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /