[Java] org.openqa.selenium.ElementClickInterceptedException:元素将其遮盖

时间:2018-10-29 02:47:35

标签: java selenium

使用以下软件和工具时:

Firefox 63
壁虎驱动程序0.23
硒3.14
Windows 7
Eclipse-Java

我遇到此消息

org.openqa.selenium.ElementClickInterceptedException:   
Element select name="outAccountData" is not clickable at point  
 (909.1583023071289,545.3499755859375) because another element   
button class="btn dropdown-toggle btn-default" type="button" obscures it

有人可以帮助我吗?谢谢
Chrome&IE在Java代码以下运行。

   WebElement box = fluentFindElement(By.xpath("//div[@class='account-input-widget' and descendant::div[contains(@class,'account-card-personal')]]"));   
            box.findElement(By.xpath(".//button[@data-toggle='dropdown']")).click();  
            String accountPath = ".//select//option[contains(text(),\'"+ acctount +"\')]";  
            box.findElement(By.xpath(accountPath)).click();

元素: Div

org.openqa.selenium.ElementClickInterceptedException: Element <select name="outAccountData"> is not clickable at point (909.1583023071289,545.3499755859375) because another element <button class="btn dropdown-toggle btn-default" type="button"> obscures it
Build info: version: '3.14.0', revision: 'aacccce0', time: '2018-08-02T20:19:58.91Z'
System info: host: '02C01XXXX9189', ip: 'XX.XXX.19.XX', os.name: 'Windows 7', os.arch: 'amd64', os.version: '6.1', java.version: '1.8.0_60'
Driver info: org.openqa.selenium.firefox.FirefoxDriver
Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 63.0, javascriptEnabled: true, moz:accessibilityChecks: false, moz:geckodriverVersion: 0.23.0, moz:headless: false, moz:processID: 10852, moz:profile: C:\Users\169314\AppData\Loc..., moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, platformVersion: 6.1, rotatable: false, setWindowRect: true, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}
Session ID: 2990c507-18a9-4ce4-967f-58562bd9c769
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:62)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:45)
    at java.lang.reflect.Constructor.newInstance(Constructor.java:422)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.createException(W3CHttpResponseCodec.java:187)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:122)
    at org.openqa.selenium.remote.http.W3CHttpResponseCodec.decode(W3CHttpResponseCodec.java:49)
    at org.openqa.selenium.remote.HttpCommandExecutor.execute(HttpCommandExecutor.java:158)
    at org.openqa.selenium.remote.service.DriverCommandExecutor.execute(DriverCommandExecutor.java:83)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:548)
    at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:276)
    at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:83)
    at chb.stepDefinitions.component.NB.NB_AccountSelect.account_personal_select(NB_AccountSelect.java:57)
    at ✽.When [NB_AccountSelect]選擇我的帳號: accountOut(cucumber/features/NB/TW03001_臺幣轉帳_單筆轉帳.feature:7)

0 个答案:

没有答案