Skip to content
Advertisement

ActionChain click() returning Web Element instead of clicking

I was wondering how to simulate a button click on a login page using Selenium. When I try the following, it gives me an error saying that the button is not clickable at the coordinates listed (635, 353).

JavaScript

When I try using an ActionChain, it returns the Web Element (the button that’s supposed to be clicked) rather click.

JavaScript

Advertisement

Answer

I doubt that it returns a WebElement instance but rather the ActionChains instance.

This is due to the signature of the method and allows to chain some actions. Here’s the click method:

JavaScript

You can see that it return self.

It won’t click until you call perform.

action.click(on_element=el).perform()

User contributions licensed under: CC BY-SA
6 People found this is helpful
Advertisement