Unable to click on Object, Other Element Would receive click


#1

I am having error with unable to click an object as below:

Unable to click on object ‘Object Repository/create campus link/Page_eClass IP 2.5/i_katalon-download’ (Root cause: org.openqa.selenium.WebDriverException: unknown error: Element <i>…</i> is not clickable at point (849, 395). Other element would receive the click: <div id=“TB_overlay” class=“TB_overlayBG”></div>
(Session info: chrome=60.0.3112.90)
(Driver info: chromedriver=2.30.477700 (0057494ad8732195794a7b32078424f92a5fce41),platform=Windows NT 10.0.15063 x86_64) (WARNING: The server did not provide any stacktrace information)
Command duration or timeout: 57 milliseconds
Build info: version: ‘2.53.0’, revision: ‘35ae25b’, time: ‘2016-03-15 17:00:58’
System info: host: ‘DELL-NB06’, ip: ‘10.0.3.138’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_102’
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities [{applicationCacheEnabled=false, rotatable=false, mobileEmulationEnabled=false, networkConnectionEnabled=false, chrome={chromedriverVersion=2.30.477700 (0057494ad8732195794a7b32078424f92a5fce41), userDataDir=C:\Users\ISAACC~1\AppData\Local\Temp\scoped_dir15868_31222}, takesHeapSnapshot=true, pageLoadStrategy=normal, databaseEnabled=false, handlesAlerts=true, hasTouchScreen=false, version=60.0.3112.90, platform=XP, browserConnectionEnabled=false, nativeEvents=true, acceptSslCerts=true, locationContextEnabled=true, webStorageEnabled=true, browserName=chrome, takesScreenshot=true, javascriptEnabled=true, cssSelectorsEnabled=true, unexpectedAlertBehaviour=}]
Session ID: 390e2e67f0c95eed49bac18278eddb01)

 
Here is my test case:

import static com.kms.katalon.core.checkpoint.CheckpointFactory.findCheckpoint
import static com.kms.katalon.core.testcase.TestCaseFactory.findTestCase
import static com.kms.katalon.core.testdata.TestDataFactory.findTestData
import static com.kms.katalon.core.testobject.ObjectRepository.findTestObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.checkpoint.CheckpointFactory as CheckpointFactory
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as MobileBuiltInKeywords
import com.kms.katalon.core.mobile.keyword.MobileBuiltInKeywords as Mobile
import com.kms.katalon.core.model.FailureHandling as FailureHandling
import com.kms.katalon.core.testcase.TestCase as TestCase
import com.kms.katalon.core.testcase.TestCaseFactory as TestCaseFactory
import com.kms.katalon.core.testdata.TestData as TestData
import com.kms.katalon.core.testdata.TestDataFactory as TestDataFactory
import com.kms.katalon.core.testobject.ObjectRepository as ObjectRepository
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WSBuiltInKeywords
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUiBuiltInKeywords
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement
import org.openqa.selenium.interactions.Actions as Actions
import com.kms.katalon.core.webui.common.WebUiCommonHelper as WebUiCommonHelper
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import org.openqa.selenium.JavascriptExecutor as JavascriptExecutor

WebUI.openBrowser(’’)

// … navigate to internal sever site’s url … login …

WebUI.click(findTestObject(‘create campus link/Page_eClass IP 2.5 (1)/a_’))

WebUI.click(findTestObject(‘create campus link/Page_eClass IP 2.5 (1)/a_add thickbox’))

WebUI.setText(findTestObject(‘create campus link/Page_eClass IP 2.5 (1)/input_linkTitle’), ‘katalon-download’)

WebUI.setText(findTestObject(‘create campus link/Page_eClass IP 2.5 (1)/input_linkURL’), ‘https://www.katalon.com/#katalon-download’)

WebUI.click(findTestObject(‘create campus link/Page_eClass IP 2.5 (1)/input_VisibleTo’))

WebUI.click(findTestObject(‘create campus link/Page_eClass IP 2.5 (1)/input_VisibleTo (1)’))

WebUI.click(findTestObject(‘create campus link/Page_eClass IP 2.5 (1)/input_VisibleTo (2)’))

WebUI.click(findTestObject(‘create campus link/Page_eClass IP 2.5 (1)/input_VisibleTo (3)’))

WebUI.click(findTestObject(‘create campus link/Page_eClass IP 2.5 (1)/input_CampusLinkAdd’))

WebUI.click(findTestObject(‘create campus link/Page_eClass IP 2.5/i_katalon-download’))

url = WebUI.getUrl()

WebUI.verifyMatch(url, ‘https://www.katalon.com/#katalon-download’, false)

WebUI.closeBrowser()


Problem with Check function
IE 11 on Windows 10 Enterprise version (cannot click on button, with no error in log)
Script runs sometimes - sometimes it doesn't run
#2

Added a short delay and it works fine, looks like the ajex have to take a little time to load.


#3

I have tried to add a line of verifyElementClickable before the click line and it does pass…


#4

Thank you very much! It worked!


verifyElementClickable = TRUE but click CMD fails ???
#5

Hi there,

You can try to click on the element using Javascript instead:

- Create a custom keyword and insert script to click on the element using Javascript:
https://docs.katalon.com/display/KD/Define+custom+keywords

Your custom keyword will be like this:

import org.openqa.selenium.WebDriver as WebDriver
import org.openqa.selenium.WebElement as WebElement
import org.openqa.selenium.interactions.Actions as Actions
import com.kms.katalon.core.webui.common.WebUiCommonHelper as WebUiCommonHelper
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import org.openqa.selenium.JavascriptExecutor as JavascriptExecutor

@Keyword
def clickUsingJS(TestObject to, int timeout)
{
WebDriver driver = DriverFactory.getWebDriver()
WebElement element = WebUiCommonHelper.findWebElement(to, timeout)
JavascriptExecutor executor = ((driver) as JavascriptExecutor)
executor.executeScript('arguments[0].click()', element)
}

Then in your test case replace ‘Click’ action with this custom keyword instead, e.g:
CustomKeywords.‘com.example.WebUIKeywords.clickUsingJS’(findTestObject('Page_LeadershipMicroStar Logistic/a_Learn More 1′), 30)

Thanks


IE 11 on Windows 10 Enterprise version (cannot click on button, with no error in log)
#6

Hi,

I was getting: ‘Unable to click on object… Other element would receive the click’ so I did the following:

1. wait for page to load
2. scroll to element
3. wait for element to be clickable
4. click

1,2,3 all passed and yet I still get the error on 4. The following is an excerpt of the console. The click in step 4 was done right after the console log says the object is clickable and yet it fails. Can somebody help?

console log:
[PASSED] - Wait for page load successfully

[PASSED] - Scroll to object ‘Object Repository/quote-to-app-dev/Page_Apply for Term Life Insurance/a_Next’ successfully

[PASSED] - Object ‘Object Repository/quote-to-app-dev/Page_Apply for Term Life Insurance/a_Next’ is clickable

[INFO] - Clicking on object: ‘Object Repository/quote-to-app-dev/Page_Apply for Term Life Insurance/a_Next’

[FAILED] - Unable to click on object ‘Object Repository/quote-to-app-dev/Page_Apply for Term Life Insurance/a_Next’


#7

This worked for me too, thanks for sharing :wink:

CustomKeywords.‘tools.ClickUsingJava.clickUsingJS’(findTestObject(‘Page_Client Details/input_submit_52F9E2050A30828D4BAK’), 30)
Using Chrome I located the xPath to use:

  1. Right click > Inspect on Save button
  2. Right click on element > Copy > Copy xPath
    xpath=//form[@id=‘editregistrationdetails’]/table[8]/tfoot[@class=‘receded’]//input[@title=‘Save’]

#8

@eddie auyeung, I had the same issue as you, and the solutions in this thread never worked for me either. It didn’t make any sense that the object could be verified as being clickable, yet it couldn’t be clicked.

I think in my case, there was some kind of JavaScript overlay (that moved/scrolled with the page) that might have been interfering (taking the click).

I stumbled upon a solution that works 100% for me…I simply preceeded the ‘Click’ step with a ‘Mouse Over’ step for the same object (and after a ‘Wait for element clickable’ step).

It may not work in all cases, but I’ve posted it here in case it works for anyone else (I stumbled across this post when troubleshooting my issue).


#9

The same Bug Here :

(Session info: chrome=70.0.3538.77)

(Driver info: chromedriver=2.35.528161 (5b82f2d2aae0ca24b877009200ced9065a772e73),platform=Windows NT 6.1.7601 SP1 x86_64) (WARNING: The server did not provide any stacktrace information)

Command duration or timeout: 0 milliseconds

Build info: version: ‘3.7.1’, revision: ‘8a0099a’, time: ‘2017-11-06T21:07:36.161Z’

System info: host: ‘BW-PC’, ip: ‘192.168.1.21’, os.name: ‘Windows 7’, os.arch: ‘amd64’, os.version: ‘6.1’, java.version: ‘1.8.0_181’

Driver info: com.kms.katalon.selenium.driver.CChromeDriver


#10

I had the same issue and basically tried every solution but only this one worked. The issue I had was the button getting clicked on Firefox but not on Google Chrome.

I created the custom keyword as you mentioned and everything worked.

Thanks you so much for your solution.

Thanks,


#11

I have the same issue. I tried Java Click, Delay, Mouse Over, Wait for element present/visible and it doesn’t work. Clicking the same object in the earlier steps of the test case works but at the subsequent steps, it is not working…What other options are available…


#12

I am also facing same issue. I have tried with delay, wait for page load, element present/clickable. clicking same object many times It seems some times pass or fail. Can anyone suggest any robust solution that can help.

Thanks you