0

I tried verifying an element present onpage using isDisplayed() it returns true. Tried Actions class and JavascriptExecutor but no luck

Able to find an element but it is not clickable.

org.openqa.selenium.WebDriverException: unknown error: Element is not clickable at point (48, 339). Other element would receive the click: <div modal-render="true" tabindex="-1" role="dialog" class="modal fade ng-isolate-scope ng-animate ng-leave ng-leave-active" uib-modal-animation-class="fade" modal-in-class="in" ng-style="{'z-index': 1050 + index*10, display: 'block'}" uib-modal-window="modal-window" size="md" index="0" animate="animate" modal-animation="true" data-ng-animate="2" style="z-index: 1050; display: block;">...</div>
  (Session info: chrome=51.0.2704.103)
  (Driver info: chromedriver=2.7.236900,platform=Windows NT 6.3 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 68 milliseconds
Build info: version: '2.53.0', revision: '35ae25b1534ae328c771e0856c93e187490ca824', time: '2016-03-15 10:43:46'
 os.name: 'Windows 10', os.arch: 'amd64', os.version: '10.0', java.version: '1.8.0_91'
Driver info: org.openqa.selenium.chrome.ChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, chrome=takesHeapSnapshot=true, databaseEnabled=false, handlesAlerts=true, version=51.0.2704.103, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true}]
Session ID: 58f38b1bcae44097a4dad7378ba32e35
    at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
    at sun.reflect.NativeConstructorAccessorImpl.newInstance(Unknown Source)
    at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(Unknown Source)
    at java.lang.reflect.Constructor.newInstance(Unknown Source)
    at org.openqa.selenium.remote.ErrorHandler.createThrowable(ErrorHandler.java:206)
    at org.openqa.selenium.remote.ErrorHandler.throwIfResponseFailed(ErrorHandler.java:158)
    at org.openqa.selenium.remote.RemoteWebDriver.execute(RemoteWebDriver.java:678)
    at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:327)
    at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:85)
2

2 Answers 2

1

There's a DIV modal in the way of the click. It's explained in the error message. Dismiss it or otherwise handle it.

Sign up to request clarification or add additional context in comments.

2 Comments

DIV modal is handled
I even tried to getURL of the page to make sure the handle is pointng to right page. I tried explicit wait also.
0

Try to use ExpectedConditions from WebDriverWait class to check the Clickable property of the element.

Many a time I have seen that element.isDisplayed/isEnabled didn't work, but this worked fine.

Eg Code:

Webdriver driver;
WebDriverWait wait = new WebDriverWait(driver, 15);
wait.until(ExpectedConditions.elementToBeClickable(By.className("xyz"))).click();

2 Comments

The element is there and an attempt to click it was made. The problem, according to the error message, was that another element was in the way.
Yeah, you might absolutely be correct. My intention was to suggest another way to check if an element is clickable. As selenium driver does not give you that functionality, by using WebdriverWait we can make sure that element is present and clickable.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.