Chrome Extension

[Python] Pytest fixture example with cleanup and teardown

# Deafult scope=function
@pytest.fixture
def browser():
    # Initialize Chrome driver
    driver = Chrome()

    # Wait implicitly for elements to be ready before attempting interactions
    driver.implicitly_wait(10)

    # Return the driver object at the end of setup
    yield driver

    # For cleanup, quit the driver
    driver.quit()
Best JSON Validator, JSON Tree Viewer, JSON Beautifier at same place. Check how cool is the tool
Was this helpful?
0 Comments