How do we parameterize the tests in SeleniumBase #938
-
|
Can we use the pytest fixtures to parameterize the tests created using SeleniumBase? Please share if there are any examples for the same. |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
There are two ways to parameterize SeleniumBase tests:
Here's an example of using Here's an example of using You'll notice that in order to use |
Beta Was this translation helpful? Give feedback.
There are two ways to parameterize SeleniumBase tests:
parameterizedlibrary.pytest.mark.parametrize.Here's an example of using
parameterized: https://github.com/seleniumbase/SeleniumBase/blob/master/examples/parameterized_test.pyHere'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.)