Scripts runs on Windows server, but not through Jenkins

Hi Duyluong,

Here are the details:

Katalon version: 6.2.1.2
Browser version: IE 11
IEDRIVERSERVER: 3.6.0.0 (I have tried as well 3.9.0.0, with the same results)

Other tests I have performed to refine the issue scope:

  • I have tried with Chrome and FF, and both work perfectly
  • I have created a Jenkins Windows desktop slave node, where I have installed the same scripts and Katalon Studio as I have in the Jenkins Windows server slave node. There, as well, the test runs perfectly from Jenkins.

So the only problem is when I try to execute in internet explorer 11, from a slave Jenkins in a Windows Server.

Just in case it helps, I can attach the difference between the IEDriverServer.log of the Windows server and the one of the Windows desktop:

WINDOWS SERVER (fails):

T 2019-08-14 15:27:50:841 server.cc(183) Process request with: URI: /session/c5dc20f2-5164-4f12-8622-1d37ad1699ff/execute/sync HTTP verb: POST
body: {
“script”: "localStorage.clear() ",
“args”: [
]
}
T 2019-08-14 15:27:50:841 server.cc(272) Entering Server::DispatchCommand
T 2019-08-14 15:27:50:841 server.cc(583) Entering Server::LookupCommand
D 2019-08-14 15:27:50:841 server.cc(281) Command: POST /session/c5dc20f2-5164-4f12-8622-1d37ad1699ff/execute/sync {
“script”: "localStorage.clear() ",
“args”: [
]
}
T 2019-08-14 15:27:50:841 server.cc(378) Entering Server::LookupSession
T 2019-08-14 15:27:50:841 IESession.cpp(191) Entering IESession::ExecuteCommand
T 2019-08-14 15:27:50:841 IECommandExecutor.cpp(125) Entering IECommandExecutor::OnSetCommand
T 2019-08-14 15:27:50:841 command.cc(31) Entering Command::Deserialize
D 2019-08-14 15:27:50:841 command.cc(36) Raw JSON command: { “name” : “executeScript”, “locator” : { “sessionid” : “c5dc20f2-5164-4f12-8622-1d37ad1699ff” }, “parameters” : {
“script”: "localStorage.clear() ",
“args”: [
]
} }
T 2019-08-14 15:27:50:841 IECommandExecutor.cpp(136) Entering IECommandExecutor::OnExecCommand
T 2019-08-14 15:27:50:841 IECommandExecutor.cpp(566) Entering IECommandExecutor::DispatchCommand
T 2019-08-14 15:27:50:841 IECommandExecutor.cpp(702) Entering IECommandExecutor::GetCurrentBrowser
T 2019-08-14 15:27:50:841 IECommandExecutor.cpp(708) Entering IECommandExecutor::GetManagedBrowser
T 2019-08-14 15:27:50:841 IECommandExecutor.cpp(654) Entering IECommandExecutor::IsAlertActive
T 2019-08-14 15:27:50:841 Browser.cpp(699) Entering Browser::GetActiveDialogWindowHandle
T 2019-08-14 15:27:50:841 Browser.cpp(205) Entering Browser::GetContentWindowHandle
D 2019-08-14 15:27:50:842 IECommandExecutor.cpp(668) No alert handle is found
T 2019-08-14 15:27:50:842 IECommandExecutor.cpp(702) Entering IECommandExecutor::GetCurrentBrowser
T 2019-08-14 15:27:50:842 IECommandExecutor.cpp(708) Entering IECommandExecutor::GetManagedBrowser
T 2019-08-14 15:27:50:842 Browser.cpp(125) Entering Browser::GetDocument
I 2019-08-14 15:27:50:842 Browser.cpp(129) No child frame focus. Focus is on top-level frame
T 2019-08-14 15:27:50:842 IESession.cpp(212) Beginning wait for response length to be not zero
T 2019-08-14 15:27:50:846 Browser.cpp(612) Entering Browser::GetDocumentFromWindow
T 2019-08-14 15:27:50:850 Script.cpp(60) Entering Script::Initialize
T 2019-08-14 15:27:50:850 Script.cpp(631) Entering Script::AddArguments
T 2019-08-14 15:27:50:850 Script.cpp(180) Entering Script::Execute
T 2019-08-14 15:27:50:850 Script.cpp(602) Entering Script::CreateAnonymousFunction
D 2019-08-14 15:27:50:857 Script.cpp(260) -2147352319 [Unknown error 0x80020101]: Failed to execute anonymous function, no exception information retrieved
T 2019-08-14 15:27:50:858 response.cc(91) Entering Response::SetErrorResponse
W 2019-08-14 15:27:50:858 response.cc(92) Error response has status code 17 and message ‘JavaScript error’ message
T 2019-08-14 15:27:50:858 response.cc(85) Entering Response::SetErrorResponse
T 2019-08-14 15:27:50:858 response.cc(78) Entering Response::SetResponse

WINDOWS DESKTOP (it works):

T 2019-08-14 09:59:51:085 server.cc(183) Process request with: URI: /session/9a421ef6-02a9-4934-a248-b319c7c61cd4/execute/sync HTTP verb: POST
body: {
“script”: “localStorage.clear()”,
“args”: [
]
}
T 2019-08-14 09:59:51:085 server.cc(272) Entering Server::DispatchCommand
T 2019-08-14 09:59:51:085 server.cc(583) Entering Server::LookupCommand
D 2019-08-14 09:59:51:085 server.cc(281) Command: POST /session/9a421ef6-02a9-4934-a248-b319c7c61cd4/execute/sync {
“script”: “localStorage.clear()”,
“args”: [
]
}
T 2019-08-14 09:59:51:088 server.cc(378) Entering Server::LookupSession
T 2019-08-14 09:59:51:088 IESession.cpp(191) Entering IESession::ExecuteCommand
T 2019-08-14 09:59:51:089 IECommandExecutor.cpp(122) Entering IECommandExecutor::OnSetCommand
T 2019-08-14 09:59:51:089 command.cc(31) Entering Command::Deserialize
D 2019-08-14 09:59:51:089 command.cc(36) Raw JSON command: { “name” : “executeScript”, “locator” : { “sessionid” : “9a421ef6-02a9-4934-a248-b319c7c61cd4” }, “parameters” : {
“script”: “localStorage.clear()”,
“args”: [
]
} }
T 2019-08-14 09:59:51:089 IECommandExecutor.cpp(133) Entering IECommandExecutor::OnExecCommand
T 2019-08-14 09:59:51:089 IECommandExecutor.cpp(454) Entering IECommandExecutor::DispatchCommand
T 2019-08-14 09:59:51:089 IECommandExecutor.cpp(577) Entering IECommandExecutor::GetCurrentBrowser
T 2019-08-14 09:59:51:089 IECommandExecutor.cpp(583) Entering IECommandExecutor::GetManagedBrowser
T 2019-08-14 09:59:51:089 IECommandExecutor.cpp(529) Entering IECommandExecutor::IsAlertActive
T 2019-08-14 09:59:51:089 Browser.cpp(700) Entering Browser::GetActiveDialogWindowHandle
T 2019-08-14 09:59:51:089 Browser.cpp(206) Entering Browser::GetContentWindowHandle
D 2019-08-14 09:59:51:093 IECommandExecutor.cpp(543) No alert handle is found
T 2019-08-14 09:59:51:094 IECommandExecutor.cpp(577) Entering IECommandExecutor::GetCurrentBrowser
T 2019-08-14 09:59:51:094 IECommandExecutor.cpp(583) Entering IECommandExecutor::GetManagedBrowser
T 2019-08-14 09:59:51:094 Browser.cpp(126) Entering Browser::GetDocument
I 2019-08-14 09:59:51:094 Browser.cpp(130) No child frame focus. Focus is on top-level frame
T 2019-08-14 09:59:51:094 IESession.cpp(212) Beginning wait for response length to be not zero
T 2019-08-14 09:59:51:912 Browser.cpp(613) Entering Browser::GetDocumentFromWindow
T 2019-08-14 09:59:51:917 Script.cpp(49) Entering Script::Initialize
T 2019-08-14 09:59:51:917 CommandHandlers\ExecuteScriptCommandHandler.cpp(85) Entering ExecuteScriptCommandHandler::PopulateArgumentArray
T 2019-08-14 09:59:51:917 Script.cpp(169) Entering Script::Execute
T 2019-08-14 09:59:51:917 Script.cpp(438) Entering Script::CreateAnonymousFunction
T 2019-08-14 09:59:51:952 Script.cpp(426) Entering Script::ConvertResultToJsonValue
T 2019-08-14 09:59:51:952 response.cc(72) Entering Response::SetSuccessResponse
T 2019-08-14 09:59:51:952 response.cc(78) Entering Response::SetResponse

You can see clearly that the instruction Script.cpp(602) Entering Script::CreateAnonymousFunction
is well handled in Windows desktop, but not in Windows Server.

As well, I provide the Jenkins log (failed job on Windows server):

2019-08-13 14:46:32.531 ERROR c.k.k.core.keyword.internal.KeywordMain - ? Unable to execute JavaScript. (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to execute JavaScript.
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.ExecuteJavaScriptKeyword.executeJavascript(ExecuteJavascriptKeyword.groovy:42)
at com.kms.katalon.core.webui.keyword.builtin.ExecuteJavaScriptKeyword.execute(ExecuteJavascriptKeyword.groovy:37)
at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:56)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.executeJavaScript(WebUiBuiltInKeywords.groovy:3787)
at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$executeJavaScript$2.call(Unknown Source)
at create new client.run(create new client:25)
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 TempTestSuite1565700365710.run(TempTestSuite1565700365710.groovy:35)
Caused by: org.openqa.selenium.JavascriptException: JavaScript error
Build info: version: ‘3.141.59’, revision: ‘e82be7d358’, time: ‘2018-11-14T08:25:53’
System info: host: ABCDEFG-01’, ip: ‘00.11.22.197’, os.name: ‘Windows Server 2016’, os.arch: ‘amd64’, os.version: ‘10.0’, java.version: ‘1.8.0_181’
Driver info: com.kms.katalon.selenium.driver.CInternetExplorerDriver
Capabilities {acceptInsecureCerts: false, browserName: internet explorer, browserVersion: 11, javascriptEnabled: true, pageLoadStrategy: normal, platform: WINDOWS, platformName: WINDOWS, se:ieOptions:

{browserAttachTimeout: 0, elementScrollBehavior: 0, enablePersistentHover: true, ie.browserCommandLineSwitches: , ie.ensureCleanSession: true, ie.fileUploadDialogTimeout: 3000, ie.forceCreateProcessApi: false, ignoreProtectedModeSettings: true, ignoreZoomSetting: false, initialBrowserUrl: http://localhost:22216/, nativeEvents: true, requireWindowFocus: false}

, setWindowRect: true}

Thanks for your help and support.