I am attempting to utilize the executeJavascript function in Katalon Studio. After writing some code resembling the example provided in the documentation, I imported WebElement into my script as well:
documentation example: https://i.sstatic.net/8Lp3P.png
my script: https://i.sstatic.net/WVm1D.png
Despite this, when running the test, an error message is displayed:
Test Cases/Forms/Test1 - fill in maintenance request form FAILED because (of) Unable to execute JavaScript. (Root cause: org.openqa.selenium.WebDriverException: unknown error: element is not defined
(Session info: chrome=66.0.3359.181)
(Driver info: chromedriver=2.35.528157 (4429ca2590d6988c0745c24c8858745aaaec01ef),platform=Mac OS X 10.13.4 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: 'Nikkis-MacBook-Pro.local', ip: 'fe80:0:0:0:18e2:b2c7:8b31:3164%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.4', java.version: '1.8.0_102'
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.35.528157 (4429ca2590d698..., userDataDir: /var/folders/fl/d70hxqb520v...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version: 66.0.3359.181, webStorageEnabled: true}
Session ID: 05ebb4c39e0862af7f3893c442527a3b)
Test Cases/Forms/Test1 - fill in maintenance request form.run:65
Even after updating selenium, chrome driver, and java, the same error persists:
Unable to execute JavaScript. (Root cause: org.openqa.selenium.WebDriverException: unknown error: element is not defined (Session info: chrome=66.0.3359.181) (Driver info: chromedriver=2.38.552518 (183d19265345f54ce39cbb94cf81ba5f15905011),platform=Mac OS X 10.13.4 x86_64) (WARNING: The server did not provide any stacktrace information) Command duration or timeout: 0 milliseconds Build info: version: '3.12.0', revision: '7c6e0b3', time: '2018-05-08T15:15:08.936Z' System info: host: 'Nikkis-MacBook-Pro.local', ip: 'fe80:0:0:0:18e2:b2c7:8b31:3164%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.13.4', java.version: '1.8.0_102' Driver info: com.kms.katalon.selenium.driver.CChromeDriver Capabilities {acceptInsecureCerts: false, acceptSslCerts: false, applicationCacheEnabled: false, browserConnectionEnabled: false, browserName: chrome, chrome: {chromedriverVersion: 2.38.552518 (183d19265345f5..., userDataDir: /var/folders/fl/d70hxqb520v...}, cssSelectorsEnabled: true, databaseEnabled: false, handlesAlerts: true, hasTouchScreen: false, javascriptEnabled: true, locationContextEnabled: true, mobileEmulationEnabled: false, nativeEvents: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, rotatable: false, setWindowRect: true, takesHeapSnapshot: true, takesScreenshot: true, unexpectedAlertBehaviour: , unhandledPromptBehavior: , version:
66.0.3359.181, webStorageEnabled: true} Session ID: 2c4f4643acb4d1c0a106ac0fb9e31254)
The continuing occurrence of this error perplexes me, and I seek guidance on how it can be resolved.