Selenium Webdriver: Element Not Visible Exception Selenium Webdriver: Element Not Visible Exception selenium selenium

Selenium Webdriver: Element Not Visible Exception


You have two buttons with given xpath on this page, first is not visible, thats why you are getting ElementNotVisibleException

One is under <div class="loginPopup">

Second (the one you need) is under <div class="page">

So change your xpath to look like this, and it will fix your problem:

By.xpath("//div[@class='page']//div[@id='_loginButton']")


There are even 3 elements with id="_loginButton" on the page, and only one is visible - the one located inside the login form, you can get it by a CSS selector:

By.cssSelector("form#_loginForm div#_loginButton")


There are 3 occurrences of id="_loginButton".

Used the id="_loginButton" under class="signIn" by cssSelector to get the exact button in the page.

By.cssSelector("div.signIn div#_loginButton")