Issue
I trying to make a login with selenium on https://www.packtpub.com/
i trying this:
def setUp(self):
self.driver = webdriver.Chrome(executable_path='C:\_workspace\projects\Packtpub\chromedriver')
self.driver.get("https://www.packtpub.com")
time.sleep(5) # Let the user actually see something!
def test_login(self):
driver = self.driver
driver.maximize_window()
login1 = driver.find_element_by_id("email-wrapper")
login1.find_element_by_id("email").send_keys("my_login")
so return this error:
ElementNotVisibleException: Message: element not visible
I don't know why
Solution
The problem is that there are 2 elements with id="email"
on page (try driver.find_elements_by_id("email")
and you will see it). So you should try
driver.find_elements_by_id("email")[1].send_keys("my_login")
Answered By - Andersson
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.