Unable to click on Object, Other Element Would receive click

Hi, my test works fine in both Chrome and Safari but for some reason on Firefox (version 54) I keep getting this error:

Test Cases/New Test Case FAILED because (of) Unable to click on object 'Object Repository/Page_Leadership MicroStar Logistic/a_Learn More 1' (Root cause: org.openqa.selenium.WebDriverException: Element <a href="#" class="btn btn-default" data-toggle="modal" data-target="#defaultInfoModal" data-image-url="http:wp-content/uploads/2017/08/MH.jpg" data-image-alt="Michael Hranicka" data-title="MICHAEL HRANICKA PRESIDENT &amp; CEO" data-body="<p>First introduced to the incredible world of beer while working for a large company, and true to his Bohemian roots, Michael dreamt of breaking free from corporate America to join a nimble, entrepreneurial company in the beer industry. Now he’s living that dream armed with a new, hand-picked leadership team and working with the best customers on earth … breweries! When he is not wandering the beer industry, he can be found hiking in the mountains with his wife and three children, attending their sporting events or meandering along a golf course.<p/><p>Style of Choice: Amber Ale</p>"></a> is not clickable at point (236.64999389648438, 15.949996948242188). Other element would receive the click: <div class="brand-bar"></div>

I tried doing scroll by element to see if that would fix it but it didn't. Any other suggestions???

Here is my test:

WebUI.openBrowser('')

WebUI.navigateToUrl('website.com')

WebUI.click(findTestObject('Page_Leadership MicroStar Logistic/a_Learn More 1'))

WebUI.waitForElementVisible(findTestObject('Page_Leadership MicroStar Logistic/button_Close'), 0)

WebUI.click(findTestObject('Page_Leadership MicroStar Logistic/button_Close'))

WebUI.click(findTestObject('Page_Leadership MicroStar Logistic/a_Learn More 2'))

WebUI.waitForElementVisible(findTestObject('Page_Leadership MicroStar Logistic/button_Close'), 0)

WebUI.click(findTestObject('Page_Leadership MicroStar Logistic/button_Close'))

WebUI.click(findTestObject('Page_Leadership MicroStar Logistic/a_Learn More 3'))

WebUI.waitForElementVisible(findTestObject('Page_Leadership MicroStar Logistic/button_Close'), 0)

WebUI.click(findTestObject('Page_Leadership MicroStar Logistic/button_Close'))

WebUI.closeBrowser()

Thank you very much! It worked!

1 Like

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

12 Likes

how do you write this as a double click instead of a single click?

2 Likes

@“Hanh Tran”, thank you so much!!
This helped me solve multiple problems. :slight_smile:

1 Like

@HHanh Tran said:

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_Leadership MicroStar Logistic/a_Learn More 1′), 30)

Thanks

It works, ty so much!!!

1 Like

Thank you SO much, this worked for me too. I love this place :slight_smile:

Thank’s a lot. It worked. :slight_smile:

I am a beginner in katalon automation testing and have only basic knowledge in coding. Iam getting the following error when i replayed a test case in FireFox which was recorded in Chrome. What to do with it?

Unable to click on object ‘Object Repository/PMAdminLoginOR/Page_PicMe - Event Manager/button_Login’ (Root cause: org.openqa.selenium.ElementClickInterceptedException: Element is not clickable at point (793.8250274658203,451.12498474121094) because another element

obscures it

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

System info: host: ‘DESKTOP-AHRJG7D’, ip: ‘192.168.0.23’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’

Driver info: com.kms.katalon.core.webui.driver.firefox.CGeckoDriver

Capabilities {acceptInsecureCerts: true, browserName: firefox, browserVersion: 63.0, javascriptEnabled: true, moz:accessibilityChecks: false, moz:geckodriverVersion: 0.23.0, moz:headless: false, moz:processID: 4892, moz:profile: C:\Users\DELL\AppData\Local…, moz:useNonSpecCompliantPointerOrigin: false, moz:webdriverClick: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, platformVersion: 10.0, proxy: Proxy(direct), rotatable: false, setWindowRect: true, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify}

Session ID: 86bbb9da-deb7-4720-b7f1-9899f158d6e7)

.Recording was login to webapp in chrome…Following error has been shown in the report when i replayed in firefox .Unable to open browser with url: ‘’ (Root cause: org.openqa.selenium.WebDriverException: Timed out waiting for driver server to start. Can anyone help. Iam just a begginer

Hi @Douglas_SIlva_Ramos
I am facing the similar kind of issue for my toggle button testing Toggle button
I have tried your solution by adding the custom keyword with the given JS
Code:
CustomKeywords.'com.example.WebUIKeywords.clickUsingJS'(findTestObject('Page_Add Address/MailOption'), 10)

Now i am getting
2019-06-24 12:36:10.195 ERROR k.k.c.m.CustomKeywordDelegatingMetaClass - :x: com.example.WebUIKeywords
2019-06-24 12:36:10.196 ERROR c.k.katalon.core.main.TestCaseExecutor - :x: Test Cases/Emma_AddNewClient/Add_New_client_Step1_Debugt FAILED.
Reason:
java.lang.ClassNotFoundException: com.example.WebUIKeywords
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.getCustomKeywordClassAndSetMetaClass(CustomKeywordDelegatingMetaClass.java:100)
at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:45)
at Add_New_client_Step1_Debugt.run(Add_New_client_Step1_Debugt:95)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:133)
at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:116)
at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:83)
at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:157)
at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
at TempTestSuite1561376149335.run(TempTestSuite1561376149335.groovy:35)
Please do the needful …

Issue resolved please refer the Toogle Button Test

Thank you !! This code really helped me.

1 Like

I use your code but it gives an error like this:
This element neither has attached source nor attached Javadoc and hence no Javadoc could be found.
I have already imported the package but it is not work. Pls help me.

I tried using this but I got error like this:

Blockquote
Test Cases/CF4/Add Profile FAILED.
Reason:
org.codehaus.groovy.control.MultipleCompilationErrorsException: startup failed:
file:/C:/Users/jquinto/Katalon%20Studio/EasyClaims%202019/Scripts/CF4/Add%20Profile/Script1564023539086.groovy: 24: unable to resolve class Keyword , unable to find class for annotation
@ line 24, column 1.
@Keyword
^

1 error

at com.kms.katalon.core.main.ScriptEngine.getScript(ScriptEngine.java:199)
at com.kms.katalon.core.main.ScriptEngine.run(ScriptEngine.java:194)
at com.kms.katalon.core.main.ScriptEngine.runScriptAsRawText(ScriptEngine.java:119)
at com.kms.katalon.core.main.TestCaseExecutor.runScript(TestCaseExecutor.java:337)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:328)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:307)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:299)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:233)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
at TempTestCase1564102877215.run(TempTestCase1564102877215.groovy:21)

Blockquote

Please help me thanks :slight_smile:

Hi Tran,

I have the same issue, i tried to create the custom keyword but i’m receiving some errors when trying to save it.

Please advise.

Thanks in advance,
Ruben B

Press Ctrl + Shift + O or add

import com.kms.katalon.core.annotation.Keyword
import com.kms.katalon.core.testobject.TestObject
1 Like

It works! Thank you so much Helene!

@Hanh_Tran

hi, i’m trying to use your script but i have this error: groovy.lang.missingpropertyexception: no such property: webuikeywords for class: script157069745665

how can i solve?

ok, now the error is: test case failed. Reason: java.lang.ClassNotFoundException: com.exampleWebUIKeywords