I am using Selenium WebDriver in Python in Pycharm, where I am using a class having 2 test functions.
class goodsweb(unittest.TestCase):
def setUp(self):
driverlocation ="/Users/new/Documents/Learning/Drivers/selenium-2.53.1/py/selenium/webdriver/chromedriver"
os.environ["webdriver.chrome.driver"] = driverlocation
self.driver = webdriver.Chrome(driverlocation)
def test_Test1(self):
self.EmailEntry = input("Please Enter Email Address: ")
self.EmailAddress.send_keys(self.EmailEntry)
self.Password.clear()
self.password='12345678'
self.Password.send_keys(self.password)
def test_Test2(self):
self.LoginEmail = driver.find_element_by_xpath("//*[@id='sign_form-default']//div[1]/input[@type='email']")
self.LoginEmail.clear()
self.LoginEmail.click()
self.LoginEmail.send_keys(self.EmailEntry)
self.LoginPassword = driver.find_element_by_xpath("//*[@id='sign_form-default']//div[1]/input[@type='password']")
self.LoginPassword.clear()
self.LoginPassword.click()
self.LoginPassword.send_keys(self.password)
Now What I want is get access of EmailEntry and Password of test_Test1 in test_Test2
Whenever I am running the code, I am having this error:
AttributeError: 'goodsweb' object has no attribute 'EmailEntry'