Selenium 2.0/WebDriver clickAt()方法不受支持 [英] Selenium 2.0 / WebDriver clickAt() method unsupported

查看:124
本文介绍了Selenium 2.0/WebDriver clickAt()方法不受支持的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Selenium clickAt()函数在与WebDriver(WebDriverBackedSelenium或仅使用ChromeDriver的Selenium 2.x)一起使用时会引发不受支持"异常.

Selenium clickAt() function is throwing "Unsupported" exception while using with WebDriver (WebDriverBackedSelenium or just Selenium 2.x using ChromeDriver).

是否可以通过WebDriver使用此Selenium函数?

Is there any way to use this Selenium function via WebDriver?

为上下文添加一些代码...

Adding some code for context ...

       ChromeDriver driver = new ChromeDriver();

    driver.findElement(By.id("someID")).clickAt("25, 25");

.clickAt()方法甚至无法识别...但是,使用WebDriverBackedSelenium是提供未处理异常的原因.

.clickAt() method isn't even recognized ... however, using the WebDriverBackedSelenium is what provides the Unhandled exception.

推荐答案

您必须使用高级用户互动API

单击元素内的特定点,如下所示:

Click at the specific point inside an element looks like following:

ActionChainsGenerator builder = ((HasInputDevices) driver).actionsBuilder();
Action action = builder
    .moveToElement(elementLocator, xOffset, yOffset)
    .click()
    .build();
action.perform();

目前,它仅适用于HtmlUnitDriver和InternetExplorerDriver,其他驱动程序正在开发中.

At the moment, it is implemented for HtmlUnitDriver and InternetExplorerDriver only, other drivers are work in progress.

这篇关于Selenium 2.0/WebDriver clickAt()方法不受支持的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆