Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

selenium python click on element nothing happens

Tags:

People also ask

Why click is not working in Selenium Python?

We can list the most common reasons for click problems as being one of the following: Wrong web element locations. The existence of a web element that obscures the web element that we want to click. The Selenium WebDriver works much faster than the response of the application.

Why is Selenium element not clickable?

Solution 4: Using Actions class in Selenium The exception “Element is not clickable at point” might be thrown when the element is not under focus or the action is being performed on the incorrect WebElement. In such cases, you have to switch to the actual element and perform the click action.

What happens when click is not working in Selenium?

Selenium clicks fail when an element is not attached to the current page. Re-find the element if the previously found element has been detached.

How do you click on an element in Selenium Python?

We can click a button with Selenium webdriver in Python using the click method. First, we have to identify the button to be clicked with the help of any locators like id, name, class, xpath, tagname or css. Then we have to apply the click method on it. A button in html code is represented by button tagname.


I am trying to click on the Gmail link on the Google frontpage in Selenium with the WebDriver on Python. My code basically replicates the one found here: Why Cant I Click an Element in Selenium?

My Code:

import selenium.webdriver as webdriver
firefox = webdriver.Firefox()
firefox.get("http://www.google.ca")
element = firefox.find_element_by_xpath(".//a[@id='gb_23']")
element.click()

The webdriver loads the page and then nothing happens. I've tried using the ActionChains and move_to_element(element), click(element), then perform() but nothing happens either.