Unable To Click on Object while Recording Steps

Every time I use the Katalon Recorder within Studio I get this weird problem where I record some steps then go to play them back and get the following error:

2024-09-18 08:02:23.413 INFO  c.k.k.core.main.WSVerificationExecutor   - --------------------
2024-09-18 08:02:23.414 INFO  c.k.k.core.main.WSVerificationExecutor   - START Verification
2024-09-18 08:02:23.571 DEBUG testcase.                                - 1: openBrowser("")
2024-09-18 08:02:24.206 INFO  c.k.k.core.webui.driver.DriverFactory    - sessionId = 85dfc319b04cf8a0b03ad4c6efacb80b
2024-09-18 08:02:24.220 INFO  c.k.k.core.webui.driver.DriverFactory    - browser = Chrome 128.0.0.0
2024-09-18 08:02:24.221 INFO  c.k.k.core.webui.driver.DriverFactory    - platform = Windows 10
2024-09-18 08:02:24.222 INFO  c.k.k.core.webui.driver.DriverFactory    - seleniumVersion = 3.141.59
2024-09-18 08:02:24.225 INFO  c.k.k.core.webui.driver.DriverFactory    - proxyInformation = ProxyInformation { proxyOption=NO_PROXY, proxyServerType=HTTP, username=, password=********, proxyServerAddress=, proxyServerPort=0, executionList="", isApplyToDesiredCapabilities=true }
[FINE] No subscribers registered for event class com.kms.katalon.core.event.TestingEvent
[FINE] No subscribers registered for event class org.greenrobot.eventbus.NoSubscriberEvent
2024-09-18 08:02:24.240 DEBUG testcase.                                - 2: navigateToUrl("https://katalon-demo-cura.herokuapp.com/")
2024-09-18 08:02:24.356 DEBUG testcase.                                - 3: click(findTestObject("Page_CURA Healthcare Service/a_Make Appointment"))
2024-09-18 08:02:24.370 WARN  c.k.k.core.testobject.ObjectRepository   - Test object with id 'Object Repository/Page_CURA Healthcare Service/a_Make Appointment' does not exist
2024-09-18 08:02:24.395 WARN  c.k.k.core.testobject.ObjectRepository   - Test object with id 'Object Repository/' does not exist
2024-09-18 08:02:24.732 ERROR c.k.k.core.keyword.internal.KeywordMain  - ? Unable to click on object (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to click on object
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:74)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:40)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:659)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$1.call(Unknown Source)
	at WSVerification1726660943460.run(WSVerification1726660943460:23)
	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.WSVerificationExecutor.runScript(WSVerificationExecutor.java:180)
	at com.kms.katalon.core.main.WSVerificationExecutor.doExecute(WSVerificationExecutor.java:174)
	at com.kms.katalon.core.main.WSVerificationExecutor.processExecutionPhase(WSVerificationExecutor.java:157)
	at com.kms.katalon.core.main.WSVerificationExecutor.accessMainPhase(WSVerificationExecutor.java:149)
	at com.kms.katalon.core.main.WSVerificationExecutor.execute(WSVerificationExecutor.java:131)
	at com.kms.katalon.core.main.TestCaseMain.runWSVerificationScript(TestCaseMain.java:150)
	at com.kms.katalon.core.main.TestCaseMain$runWSVerificationScript$0.call(Unknown Source)
	at TempTestCase1726660941017.run(TempTestCase1726660941017.groovy:25)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Caused by: java.lang.IllegalArgumentException: Object is null
	at com.kms.katalon.core.helper.KeywordHelper.checkTestObjectParameter(KeywordHelper.java:33)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:62)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.call(ClickKeyword.groovy)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
	... 19 more
)
2024-09-18 08:02:24.736 ERROR c.k.k.core.main.WSVerificationExecutor   - ? Verification FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to click on object
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.stepFailed(WebUIKeywordMain.groovy:64)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:26)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:74)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:40)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:659)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$1.call(Unknown Source)
	at WSVerification1726660943460.run(WSVerification1726660943460:23)
	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.WSVerificationExecutor.runScript(WSVerificationExecutor.java:180)
	at com.kms.katalon.core.main.WSVerificationExecutor.doExecute(WSVerificationExecutor.java:174)
	at com.kms.katalon.core.main.WSVerificationExecutor.processExecutionPhase(WSVerificationExecutor.java:157)
	at com.kms.katalon.core.main.WSVerificationExecutor.accessMainPhase(WSVerificationExecutor.java:149)
	at com.kms.katalon.core.main.WSVerificationExecutor.execute(WSVerificationExecutor.java:131)
	at com.kms.katalon.core.main.TestCaseMain.runWSVerificationScript(TestCaseMain.java:150)
	at com.kms.katalon.core.main.TestCaseMain$runWSVerificationScript$0.call(Unknown Source)
	at TempTestCase1726660941017.run(TempTestCase1726660941017.groovy:25)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:77)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
Caused by: java.lang.IllegalArgumentException: Object is null
	at com.kms.katalon.core.helper.KeywordHelper.checkTestObjectParameter(KeywordHelper.java:33)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:62)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.call(ClickKeyword.groovy)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
	... 19 more

2024-09-18 08:02:24.739 INFO  c.k.k.core.main.WSVerificationExecutor   - END Verification

But if I then hit save script and ‘add’ the objects to the repo it will work and I can open up the recorder again. How do I stop this from happening on the first attempt to record steps and play them back?

1 Like

Hi there, :wave:

Thank you very much for your topic! It may take a little while before Katalon team member or others forum members respond to you.

In the meantime, you can double-check your post to see if you can add any extra information i.e. error logs, HTML codes, screenshots, etc. Check out this posting guide to help us help you better!

Thanks! :sunglasses:
Katalon Community team

One of the issues with just recording your steps is you do not take into account the TIME that may occur between events, such as moving from one page to another. As an example, in your test script above, you “navigate” to your web site and then click on the “make appointment” button. However, you can add waits, or delays, between these statements so that you insure better testing, such as:

WebUI.navigateToUrl("https://katalon-demo-cura.herokuapp.com/")
WebUI.waitForPageLoad(10)

// I like to make sure the page is stable first
WebUI.waitForElementVisible(findTestObject("Page_CURA Healthcare Service/a_Make Appointment"), 10)
WebUI.click(findTestObject("Page_CURA Healthcare Service/a_Make Appointment"))

See if this helps your test case.
Oh, and it looks like you are using the Web Recorder of Katalon Studio, not Katalon Recorder, which is a different application.

Edit: can we see your actual code because it seems you have some issues with the code, or your Object Repository, too.
Edit2: and YES you have to Save your objects to the Object Repository before you can run your scripts. If you look at the “findTestObject”, you will see a pathway that starts with “Object Repository”. So Save your objects before you run your scripts.

1 Like