executeJavaScript/Click fails under Docker

I am trying to run this in Docker, unfortunately a normal click does’nt work, so i had it try to click through javascript and it still failed, heres the error from my command line

2019-10-21 20:22:13.905 DEBUG testcase.RTLoginPage                     - 31: element = findWebElement(findTestObject("Object Repository/Login Repo/Page_Rp  Login/button_Sign In"), 30)
2019-10-21 20:22:14.014 DEBUG testcase.RTLoginPage                     - 32: executeJavaScript("arguments[0].click()", Arrays.asList(element))
2019-10-21 20:22:15.652 WARN  c.k.k.c.w.h.s.WebUIScreenCaptor          - Cannot take screenshot
2019-10-21 20:22:15.666 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$5.call(Unknown Source)
	at RTLoginPage.run(RTLoginPage:81)
	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:169)
	at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:142)
	at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:91)
	at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:157)
	at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
	at TempTestSuite1571689298337.run(TempTestSuite1571689298337.groovy:35)
Caused by: org.openqa.selenium.WebDriverException: unknown error: session deleted because of page crash
from unknown error: cannot determine loading status
from tab crashed

@Mohammed1 I split this off into a new Topic.

The actual error is:

Caused by: org.openqa.selenium.WebDriverException: unknown error: session deleted because of page crash
from unknown error: cannot determine loading status
from tab crashed

We’ll need some expert eyes on this: @devalex88 @ThanhTo @duyluong

Hey Russ, it seems like this message only appears if the click fails, the script passes on a container sometimes and fails most of the times, with no changes to the script. The Docker container is a linux server, the same-one given by Katalon in the doc

The JS code looks fine. The error looks like a failure in comms/handshaking. But I’m certainly not the expert with Docker containers or Linux.

Sit tight and wait for the devs to take a look (in about 4-5 hours or so).

After thought: @Ibus?

Please enable video recording and see what happened.

In addition to the advices above, try the solution suggested here:

1 Like

Good find, @ThanhTo!

This answer purports to be the fix: https://stackoverflow.com/a/53970825

How would i add this-v /dev/shm:/dev/shm in the run_chrome.sh script?

Hi @Mohammed1

Try adding the arguments to the desired capabilities.

Worked like a charm @ThanhTo @Russ_Thomas thank you guys so much!

1 Like