Bird
0
0

Given this conftest.py fixture:

medium📝 Predict Output Q4 of 15
Selenium Python - Test Framework Integration (pytest)
Given this conftest.py fixture:
@pytest.fixture
def browser():
    return "ChromeDriver"

What will this test print?
def test_driver(browser):
    print(browser)
Abrowser
BChromeDriver
CNone
DError: fixture not found
Step-by-Step Solution
Solution:
  1. Step 1: Understand fixture return value

    The fixture named browser returns the string "ChromeDriver".
  2. Step 2: Analyze test function usage

    The test function receives the fixture value as the browser argument and prints it.
  3. Final Answer:

    ChromeDriver -> Option B
  4. Quick Check:

    Fixture return value = printed output [OK]
Quick Trick: Fixture return value is passed as argument [OK]
Common Mistakes:
  • Expecting fixture name printed instead of return value
  • Assuming None is printed
  • Thinking fixture is not found

Want More Practice?

15+ quiz questions · All difficulty levels · Free

Free Signup - Practice All Questions
More Selenium Python Quizzes