This is my conftest file
This is my test file defined
Getting attribute error when i ran
Conftest.py
@pytest.fixture(scope= "class")
def setup(request):
driver = webdriver.Chrome()
driver.get('https://google.com/')
driver.maximize_window()
request.cls.driver = driver
test_sampletest.py
@pytest.mark.usefixtures("setup")
class TestBzHomePage:
def test_benzinga_landing(self):
# self.wait.until(EC.element_to_be_clickable((By.ID, "email"))).click()
self.driver.find_element(By.ID, "email").send_keys("[email protected]")
self.driver.find_element(By.ID, "current-password").send_keys("testtest")
bz1 = TestBzHomePage()
bz1.test_benzinga_landing()
Error I got –
ERROR testCases/test_BzRegression_Suit.py – AttributeError: ‘TestBzHomePage’ object has no attribute ‘driver’
Please help to resolve this issues my goal is to define browser launch in setup across all test files once and yeild when session ends by driver,close