Skip to content

How do we parameterize the tests in SeleniumBase #938

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

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

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
2 participants