Имею следующий простенький код, который выполняется только с Gecko (Firefox) driver.
Тот же код с любым другим драйвером кидает exception:
Exception in thread "main" java.lang.AbstractMethodError: org.openqa.selenium.remote.RemoteWebElement.getCoordinates()Lorg/openqa/selenium/interactions/Coordinates;
at org.openqa.selenium.interactions.internal.MouseAction.getActionLocation(MouseAction.java:69)
at org.openqa.selenium.interactions.MoveMouseAction.perform(MoveMouseAction.java:42)
at org.openqa.selenium.interactions.CompositeAction.perform(CompositeAction.java:34)
at org.openqa.selenium.interactions.Actions$BuiltAction.perform(Actions.java:642)
at utils.CheckActions.main(CheckActions.java:36)
Код:
import org.openqa.selenium.Cookie; import org.openqa.selenium.WebDriver; import org.openqa.selenium.WebElement; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.selenium.edge.EdgeDriver; import org.openqa.selenium.firefox.FirefoxDriver; import org.openqa.selenium.interactions.Actions; import java.util.concurrent.TimeUnit; public class CheckActions { public static void main(String[] args) { // System.setProperty("webdriver.gecko.driver", "geckodriver.exe"); System.setProperty("webdriver.chrome.driver", "chromedriver.exe"); // WebDriver driver = new FirefoxDriver(); WebDriver driver = new ChromeDriver(); driver.manage().timeouts().implicitlyWait(10, TimeUnit.SECONDS); driver.manage().window().maximize(); driver.get("http://google.com"); Actions action = new Actions(driver); WebElement field = driver.findElement(By.xpath("//input[@name='q']")); //action.sendKeys(field, "BLABLABLA").build().perform(); action.moveToElement(field).build().perform(); driver.close(); } }