I have this error message when i execute Jenkins build :
CategoriesTest.test_add_to_cart_with_login
self = <addToCartWithLogin.CategoriesTest testMethod=test_add_to_cart_with_login>
def test_add_to_cart_with_login(self):
> driver = self.driver
E AttributeError: 'CategoriesTest' object has no attribute 'driver'
com/decathlonWEB21/POMProject/Tests/Cart/addToCartWithLogin.py:35: AttributeError
My code :
def setUp(self):
if os.getenv('CHROMEWEBDRIVER'):
chromewebdriverbin = os.getenv('CHROMEWEBDRIVER')
else:
self.driver = webdriver.Chrome()
self.driver.maximize_window()
def test_add_to_cart_with_login(self):
driver = self.driver
self.driver.verificationErrors = []
self.driver.accept_next_alert = True
driver.get(beta_url)
home = HomePage(driver)
product = ProductPage(driver)
login = LoginPage(driver)
thanks
CodePudding user response:
I have solve it by updating chromedriver on jenkins who used old version