Checkbox click works in Katalon Recorder, but not in Katalon Studio

Greetings,

I’ve recorded a script in both Katalon Recorder, and Katalon Studio.

The script runs perfectly in Katalon Recorder, but fails when the same steps are recorded in Katalon Studio.

Here’s how Katalon Recorder is executing a click on a checkbox:

xpath=(//input[@name=‘fileNamecheckbox’])[3]
//ul[@id=‘migration’]/li[14]/input
//li[14]/input
css=li.file.ext_jpg > input[name=“fileNamecheckbox”]

That works perfectly when executed in Katalon Recorder. But in Katalon Studio, the script always fails and the checkbox is not clicked.

Here’s the same line from Katalon Studio:

WebUI.click(findTestObject(‘Object Repository/Page_AOMA/input_video_cover_3000x3000jpg_fileNamecheckbox’))

Is there any way to make this work?

Regards,
Jack

We’ll need more information about the test object.

Read this:

Greetings,

Here’s more info. I can only provide a limited amount since the testing I’m doing is on a proprietary website and our clients security concerns are of the highest priority.

Screenshot of the checkbox I want to click. Please note that it exists in a UI that pops up over the main website UI:
image

Underlying HTML:

Test case code. I can only post the line that’s having trouble:

Console errors (I’VE HIDDEN/REMOVED PROPRIETARY ITEMS)
2020-08-12 13:53:02.750 INFO c.k.katalon.core.main.TestCaseExecutor - --------------------
2020-08-12 13:53:02.755 INFO c.k.katalon.core.main.TestCaseExecutor - START Test Cases/SimpleUploadCover
2020-08-12 13:53:03.213 DEBUG testcase.SimpleUploadCover - 1: openBrowser("")
2020-08-12 13:53:03.552 INFO c.k.k.core.webui.driver.DriverFactory - Starting ‘Chrome’ driver
Aug 12, 2020 1:53:03 PM org.openqa.selenium.remote.DesiredCapabilities chrome
INFO: Using new ChromeOptions() is preferred to DesiredCapabilities.chrome()
2020-08-12 13:53:03.578 INFO c.k.k.c.w.util.WebDriverPropertyUtil - User set preference: [‘args’, ‘[start-maximized, load-extension=C:\Users\12012\Desktop\kpoecbkildamnnchnlgoboipnblgikpn\3.9.7.4_0, disable-extensions-except=C:\Users\12012\Desktop\kpoecbkildamnnchnlgoboipnblgikpn\3.9.7.4_0]’]
2020-08-12 13:53:03.613 INFO c.k.k.core.webui.driver.DriverFactory - Action delay is set to 0 milliseconds
Starting ChromeDriver 83.0.4103.39 (ccbf011cb2d2b19b506d844400483861342c20cd-refs/branch-heads/4103@{#416}) on port 25560
Only local connections are allowed.
Please see https://chromedriver.chromium.org/security-considerations for suggestions on keeping ChromeDriver safe.
ChromeDriver was started successfully.
[1597254785.685][WARNING]: This version of ChromeDriver has not been tested with Chrome version 84.
Aug 12, 2020 1:53:07 PM org.openqa.selenium.remote.ProtocolHandshake createSession
INFO: Detected dialect: W3C
2020-08-12 13:53:07.828 INFO c.k.k.core.webui.driver.DriverFactory - sessionId = 6cc34341f2b0654a5122bf12474574ab
2020-08-12 13:53:07.848 INFO c.k.k.core.webui.driver.DriverFactory - browser = Chrome 84.0.4147.125
2020-08-12 13:53:07.849 INFO c.k.k.core.webui.driver.DriverFactory - platform = Windows 10
2020-08-12 13:53:07.849 INFO c.k.k.core.webui.driver.DriverFactory - seleniumVersion = 3.141.59
2020-08-12 13:53:07.850 INFO c.k.k.core.webui.driver.DriverFactory - proxyInformation = ProxyInformation { proxyOption=NO_PROXY, proxyServerType=HTTP, username=, password=********, proxyServerAddress=, proxyServerPort=0, executionList="", isApplyToDesiredCapabilities=true }
2020-08-12 13:53:07.875 DEBUG testcase.SimpleUploadCover - 2: navigateToUrl(“URL REMOVED”)
2020-08-12 13:53:09.081 DEBUG testcase.SimpleUploadCover - 3: click(findTestObject(“Object Repository/Page_HIDDEN TEXT Login/input_Forget password_user”))
2020-08-12 13:53:09.300 DEBUG testcase.SimpleUploadCover - 4: click(findTestObject(“Object Repository/Page_HIDDEN TEXT Login/input_Forget password_user”))
2020-08-12 13:53:09.429 DEBUG testcase.SimpleUploadCover - 5: setText(findTestObject(“Object Repository/Page_HIDDEN TEXT Login/input_Forget password_user”), “HIDDEN”)
2020-08-12 13:53:09.632 DEBUG testcase.SimpleUploadCover - 6: click(findTestObject(“Object Repository/Page_HIDDEN TEXT Login/input_Forget password_user”))
2020-08-12 13:53:09.775 DEBUG testcase.SimpleUploadCover - 7: setEncryptedText(findTestObject(“Object Repository/Page_HIDDEN TEXT Login/input_Forget password_pass”), “HIDDEN”)
2020-08-12 13:53:10.001 DEBUG testcase.SimpleUploadCover - 8: click(findTestObject(“Object Repository/Page_HIDDEN TEXT Login/input_Forget password_Login”))
2020-08-12 13:53:30.508 DEBUG testcase.SimpleUploadCover - 9: click(findTestObject(“Object Repository/Page_HIDDEN TEXT/img”))
2020-08-12 13:53:31.179 DEBUG testcase.SimpleUploadCover - 10: setText(findTestObject(“Object Repository/Page_HIDDEN TEXT/input_Product Number_productKey”), "G010001983435C ")
2020-08-12 13:53:31.528 DEBUG testcase.SimpleUploadCover - 11: click(findTestObject(“Object Repository/Page_HIDDEN TEXT/input_Product Number_submit”))
2020-08-12 13:53:37.313 DEBUG testcase.SimpleUploadCover - 12: click(findTestObject(“Object Repository/Page_HIDDEN TEXT/input_upload_masterRegistrationStatusButton”))
2020-08-12 13:53:41.320 DEBUG testcase.SimpleUploadCover - 13: click(findTestObject(“Object Repository/Page_HIDDEN TEXT/input_ Priority _addFromHIDDEN TEXTFileButton”))
2020-08-12 13:53:41.660 DEBUG testcase.SimpleUploadCover - 14: click(findTestObject(“Object Repository/Page_HIDDEN TEXT/a_migration”))
2020-08-12 13:53:41.991 DEBUG testcase.SimpleUploadCover - 15: click(findTestObject(“Object Repository/Page_HIDDEN TEXT/li_video_cover_3000x3000jpg”))
2020-08-12 13:53:42.699 ERROR c.k.k.core.keyword.internal.KeywordMain - :x: Unable to click on object ‘Object Repository/Page_HIDDEN TEXT/li_video_cover_3000x3000jpg’ (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to click on object ‘Object Repository/Page_HIDDEN TEXT/li_video_cover_3000x3000jpg’
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:76)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:43)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:73)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:616)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$1.call(Unknown Source)
at SimpleUploadCover.run(SimpleUploadCover:47)
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:339)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:330)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:309)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:301)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:235)
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 TempTestCase1597254780484.run(TempTestCase1597254780484.groovy:25)
Caused by: org.openqa.selenium.ElementNotInteractableException: element not interactable
(Session info: chrome=84.0.4147.125)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘LAPTOP-5QS5MJP0’, ip: ‘172.16.158.213’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 84.0.4147.125, chrome: {chromedriverVersion: 83.0.4103.39 (ccbf011cb2d2b…, userDataDir: C:\Users\12012\AppData\Loca…}, goog:chromeOptions: {debuggerAddress: localhost:64350}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:virtualAuthenticators: true}
Session ID: 6cc34341f2b0654a5122bf12474574ab
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:552)
at com.kms.katalon.selenium.driver.CChromeDriver.execute(CChromeDriver.java:19)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:285)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:84)
at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.lambda$new$0(EventFiringWebDriver.java:404)
at com.sun.proxy.$Proxy10.click(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.click(EventFiringWebDriver.java:417)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:69)
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)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:76)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:43)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:73)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:616)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$1.call(Unknown Source)
at Script1597254253335.run(Script1597254253335.groovy:47)
… 11 more
)
2020-08-12 13:53:42.702 ERROR c.k.katalon.core.main.TestCaseExecutor - :x: Test Cases/SimpleUploadCover FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to click on object ‘Object Repository/Page_HIDDEN TEXT/li_video_cover_3000x3000jpg’
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:76)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:43)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:73)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:616)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$1.call(Unknown Source)
at SimpleUploadCover.run(SimpleUploadCover:47)
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:339)
at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:330)
at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:309)
at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:301)
at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:235)
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 TempTestCase1597254780484.run(TempTestCase1597254780484.groovy:25)
Caused by: org.openqa.selenium.ElementNotInteractableException: element not interactable
(Session info: chrome=84.0.4147.125)
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ‘LAPTOP-5QS5MJP0’, ip: ‘172.16.158.213’, os.name: ‘Windows 10’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 84.0.4147.125, chrome: {chromedriverVersion: 83.0.4103.39 (ccbf011cb2d2b…, userDataDir: C:\Users\12012\AppData\Loca…}, goog:chromeOptions: {debuggerAddress: localhost:64350}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:virtualAuthenticators: true}
Session ID: 6cc34341f2b0654a5122bf12474574ab
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:552)
at com.kms.katalon.selenium.driver.CChromeDriver.execute(CChromeDriver.java:19)
at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:285)
at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:84)
at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.lambda$new$0(EventFiringWebDriver.java:404)
at com.sun.proxy.$Proxy10.click(Unknown Source)
at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.click(EventFiringWebDriver.java:417)
at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:69)
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)
… 17 more

2020-08-12 13:53:42.706 INFO c.k.katalon.core.main.TestCaseExecutor - END Test Cases/SimpleUploadCover

NOTES:
Running the test using CustomChrome because a plugin needs to be loaded.

As mentioned, if I capture and run with Katalon Recorder, the test executes perfectly every time, and the checkbox gets checked.

Regards,
Jack

There’s your problem.

Are you waiting for it to be ready? Do you have Smart wait turned on?

You could also try…

Greetings,

I disabled smart wait, but that has no effect.

I am not sure how or where to add “enhanced click” using my test code.

Could you possibly show me using my script?

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 static com.kms.katalon.core.testobject.ObjectRepository.findWindowsObject
import com.kms.katalon.core.checkpoint.Checkpoint as Checkpoint
import com.kms.katalon.core.cucumber.keyword.CucumberBuiltinKeywords as CucumberKW
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.testdata.TestData as TestData
import com.kms.katalon.core.testobject.TestObject as TestObject
import com.kms.katalon.core.webservice.keyword.WSBuiltInKeywords as WS
import com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords as WebUI
import com.kms.katalon.core.windows.keyword.WindowsBuiltinKeywords as Windows
import internal.GlobalVariable as GlobalVariable
import org.openqa.selenium.Keys as Keys

WebUI.openBrowser(’’)

WebUI.disableSmartWait()

WebUI.navigateToUrl(‘URL Hidden’)

WebUI.click(findTestObject(‘Object Repository/Page_HIDDEN TEXT Login/input_Forget password_user’))

WebUI.click(findTestObject(‘Object Repository/Page_HIDDEN TEXT Login/input_Forget password_user’))

WebUI.setText(findTestObject(‘Object Repository/Page_HIDDEN TEXT Login/input_Forget password_user’), ‘HIDDEN’)

WebUI.click(findTestObject(‘Object Repository/Page_HIDDEN TEXT Login/input_Forget password_user’))

WebUI.setEncryptedText(findTestObject(‘Object Repository/Page_HIDDEN TEXT Login/input_Forget password_pass’), ‘HIDDEN’)

WebUI.click(findTestObject(‘Object Repository/Page_HIDDEN TEXT Login/input_Forget password_Login’))

WebUI.click(findTestObject(‘Object Repository/Page_HIDDEN TEXT/img’))

WebUI.setText(findTestObject(‘Object Repository/Page_HIDDEN TEXT/input_Product Number_productKey’), 'G010001983435C ')

WebUI.click(findTestObject(‘Object Repository/Page_HIDDEN TEXT/input_Product Number_submit’))

WebUI.click(findTestObject(‘Object Repository/Page_HIDDEN TEXT/input_upload_masterRegistrationStatusButton’))

WebUI.click(findTestObject(‘Object Repository/Page_HIDDEN TEXT/input_ Priority _addFromHIDDEN TEXTFileButton’))

WebUI.click(findTestObject(‘Object Repository/Page_HIDDEN TEXT/a_migration’))

WebUI.click(findTestObject(‘Object Repository/Page_HIDDEN TEXT/li_video_cover_3000x3000jpg’))

WebUI.click(findTestObject(‘Object Repository/Page_HIDDEN TEXT/li_video_cover_3000x3000jpg’))

WebUI.click(findTestObject(‘Object Repository/Page_HIDDEN TEXT/input_video_cover_3000x3000jpg_fileNamecheckbox’))

WebUI.click(findTestObject(‘Object Repository/Page_HIDDEN TEXT/li_video_cover_3000x3000jpg’))

WebUI.click(findTestObject(‘Object Repository/Page_HIDDEN TEXT/span_Add Files’))

WebUI.click(findTestObject(‘Object Repository/Page_HIDDEN TEXT/input_click here to get the plugin_masterSu_22d64d’))

Regards,
Jack

Take any WebUI.click(...) and replace with WebUI.enhancedClick(...)

1 Like

It worked! Thank you! You made my day! You rock!!!

1 Like