Bird
0
0

What is the main purpose of using @pytest.mark.parametrize in Selenium Python tests?

easy📝 Conceptual Q11 of 15
Selenium Python - Data-Driven Testing
What is the main purpose of using @pytest.mark.parametrize in Selenium Python tests?
ATo run tests in parallel threads
BTo skip tests that are not ready
CTo run the same test function multiple times with different input data
DTo generate HTML reports automatically
Step-by-Step Solution
Solution:
  1. Step 1: Understand the decorator's role

    @pytest.mark.parametrize allows running one test function multiple times with different sets of input data.
  2. Step 2: Compare with other options

    Skipping tests, running in parallel, or generating reports are different pytest features, not related to parameterization.
  3. Final Answer:

    To run the same test function multiple times with different input data -> Option C
  4. Quick Check:

    Parameterize = run test with many inputs [OK]
Quick Trick: Parameterize means run test repeatedly with different data [OK]
Common Mistakes:
  • Confusing parameterize with skipping tests
  • Thinking it runs tests in parallel
  • Assuming it generates reports

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Python Quizzes