vini007
vini007

Reputation: 597

Selenium 3.14.0+ ClassCast Exception for Actions.movetoElement after upgrading selenium

I have upgraded selenium to latest version 3.14.0, and found that the following method is throwing a class cast exception

new Actions(driver).moveToElement(element).click().build().perform();

java.lang.ClassCastException: com.prahs.utils.logger.EventWebDriver$EventFiringWebElement cannot be cast to org.openqa.selenium.interactions.internal.Locatable

Upvotes: 1

Views: 971

Answers (2)

Joe Cole
Joe Cole

Reputation: 21

You may using different versions Selenium for api.

It is likely related to this?

Selenium Actions Class cannot be resolved in selenium version greater then 3.1

Upvotes: 0

Ishita Shah
Ishita Shah

Reputation: 4035

You may try this way,

Actions action = new Actions(driver);
action.moveToElement("Web Element").click().perform();

Build is for different purpose,

Reference Link : https://seleniumhq.github.io/selenium/docs/api/java/org/openqa/selenium/interactions/Actions.html

Upvotes: 1

Related Questions