6. Pytest Fixtures for Driver Management

Pytest Fixture with Yield

@pytest.fixture
def browser():
    driver = webdriver.Chrome()
    yield driver
    driver.quit()

Task

  • Complete the fixture: `yield driver` and call `driver.quit()`.
💡Common doubts
Did you like the problem?
Lesson 6 of 8
Python
Loading code editor…
Next