每当我尝试在Katalon Studio中使用.executeJavascript方法时,我都会出现此错误:
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.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:ce9:9ff4:b41c:6af1%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: 3f8395c7ba99d8ae3ec674ea2312a05f)
我认为我收到此错误是因为使用的java版本很旧(见错误信息):java.version:'1.8.0_102'。
然而,即使在我下载并安装了java 1.8.0_172之后,Katalon Studio仍然使用旧版本的java来运行测试。为什么这样,我怎么能改变java版本?
答案 0 :(得分:0)
这不是java版本问题。 尝试使用稳定正确的chromedriver版本。
参考已经回答的问题: https://stackoverflow.com/a/48665237/4358787