Katalon Docker. Cannot take screenshot. Caused by: org.openqa.selenium.WebDriverException: unknown error: session deleted because of page crash

Please let us know what you are using Katalon Studio for?

I have currently applied Katalon Studio in my project. My company has a floating license for KRE.

How would your work be affected if this issue has not been resolved?

I can continue my job, resolving this ticket can boost my performance

Operating System

Windows 11

Katalon Studio Docker image: 8.2.0

Screenshots / Videos

ErrorLog
FAILED	Cannot take screenshot (Root cause: com.kms.katalon.core.exception.StepFailedException: Cannot take screenshot
	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.TakeFullPageScreenshotKeyword.takeScreenshot(TakeFullPageScreenshotKeyword.groovy:125)
	at com.kms.katalon.core.webui.keyword.builtin.TakeFullPageScreenshotKeyword.execute(TakeFullPageScreenshotKeyword.groovy:82)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.takeFullPageScreenshot(WebUiBuiltInKeywords.groovy:3225)
	at generalKeyword.GeneralKeyword.takeFullPageScreenshot(GeneralKeyword.groovy:111)
	at generalKeyword.GeneralKeyword.invokeMethod(GeneralKeyword.groovy)
	at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:50)
	at 117_register_user_with_password_of_99_characters.run(117_register_user_with_password_of_99_characters:157)
	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:442)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:433)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:412)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:404)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:281)
	at com.kms.katalon.core.main.TestSuiteExecutor.accessTestCaseMainPhase(TestSuiteExecutor.java:202)
	at com.kms.katalon.core.main.TestSuiteExecutor.accessTestSuiteMainPhase(TestSuiteExecutor.java:164)
	at com.kms.katalon.core.main.TestSuiteExecutor.execute(TestSuiteExecutor.java:105)
	at com.kms.katalon.core.main.TestCaseMain.startTestSuite(TestCaseMain.java:181)
	at com.kms.katalon.core.main.TestCaseMain$startTestSuite$0.call(Unknown Source)
	at TempTestSuite1637574004016.run(TempTestSuite1637574004016.groovy:36)
Caused by: java.lang.RuntimeException: java.lang.reflect.InvocationTargetException
	at com.assertthat.selenium_shutterbug.utils.web.Browser.sendCommand(Browser.java:678)
	at com.assertthat.selenium_shutterbug.utils.web.Browser.takeFullPageScreenshotChromeCommand(Browser.java:549)
	at com.assertthat.selenium_shutterbug.utils.web.Browser.takeFullPageScreenshot(Browser.java:150)
	at com.assertthat.selenium_shutterbug.core.Shutterbug.shootPage(Shutterbug.java:154)
	at com.assertthat.selenium_shutterbug.core.Shutterbug.shootPage(Shutterbug.java:83)
	at com.assertthat.selenium_shutterbug.core.Shutterbug.shootPage(Shutterbug.java:69)
	at com.kms.katalon.core.webui.util.FileUtil.takeFullPageScreenshot(FileUtil.java:86)
	at com.kms.katalon.core.webui.keyword.builtin.TakeFullPageScreenshotKeyword$_takeScreenshot_closure1.doCall(TakeFullPageScreenshotKeyword.groovy:126)
	at com.kms.katalon.core.webui.keyword.builtin.TakeFullPageScreenshotKeyword$_takeScreenshot_closure1.call(TakeFullPageScreenshotKeyword.groovy)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
	at com.kms.katalon.core.webui.keyword.builtin.TakeFullPageScreenshotKeyword.takeScreenshot(TakeFullPageScreenshotKeyword.groovy:125)
	at com.kms.katalon.core.webui.keyword.builtin.TakeFullPageScreenshotKeyword.execute(TakeFullPageScreenshotKeyword.groovy:82)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:74)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.takeFullPageScreenshot(WebUiBuiltInKeywords.groovy:3225)
	at generalKeyword.GeneralKeyword.takeFullPageScreenshot(GeneralKeyword.groovy:111)
	at generalKeyword.GeneralKeyword.invokeMethod(GeneralKeyword.groovy)
	at com.kms.katalon.core.main.CustomKeywordDelegatingMetaClass.invokeStaticMethod(CustomKeywordDelegatingMetaClass.java:50)
	at Script1635323929739.run(Script1635323929739.groovy:157)
	... 13 more
Caused by: java.lang.reflect.InvocationTargetException
	at com.assertthat.selenium_shutterbug.utils.web.Browser.sendCommand(Browser.java:675)
	... 30 more
Caused by: org.openqa.selenium.WebDriverException: unknown error: session deleted because of page crash
from unknown error: cannot determine loading status
from tab crashed
  (Session info: chrome=96.0.4664.45)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'caad169db9b8', ip: 'x.x.x.x', os.name: 'Linux', os.arch: 'amd64', os.version: '5.4.72-microsoft-standard-WSL2', java.version: '1.8.0_292'
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 96.0.4664.45, chrome: {chromedriverVersion: 96.0.4664.45 (76e4c1bb2ab46..., userDataDir: /tmp/.com.google.Chrome.7fP8rS}, goog:chromeOptions: {debuggerAddress: localhost:41235}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: LINUX, platformName: LINUX, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:extension:credBlob: true, webauthn:extension:largeBlob: true, webauthn:virtualAuthenticators: true}
Session ID: c0c3c10b63a6647e9995647b38032c55
	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)
	... 31 more
)                             	
INFO	com.kms.katalon.core.exception.StepFailedException: Cannot take screenshot 

Environment (for Web testing):

Chrome Browser and Driver: 96.0.4664.45

Steps to reproduce:

Actual Behavior:

We have some test case which are working perfectly on local Katalon Studio with chrome browser and driver 96.0.4664.45.

We are integrating our test in Jenkins and are using Katalon docker image for running test case in Jenkins.

With Katalon docker image 8.2.0 we have some test case that are failing when taking a full page screenshot. The Keyword that performs the action is working fine for others test case even in the test case where we got a failure. So I don’t think the Keyword we defined is the cause.
In the test case where it’s failing it happens when taking the final screenshot of a page where we have a JSON format and there is a vertical scroll bar.

For the moment we put in place a work around to catch the screenshot error and to not fail the test case. But still we need to understand where is the problem.

Before raising that issue, we tried to understand and find a solution from the community. The post is here

As there test cases are working fine on local Katalon Studio and not with Katalon Docker image, maybe it’s something with Katalon docker image.
We built a custom image with same version of chrome browser and driver as the local Katalon Studio but the error is still happening.

Expected Behavior:

No error when taking a screenshot of a page with vertical scroll bar

Any update about that issue?

Hi @giang.tong,
I saw your name appeared in that document https://docs.katalon.com/katalon-studio/docs/webui-take-fullpage-screenshot.html#takefullpagescreenshot so I want to ask your opinion about that bug I reported.

Do you have any advice? Thanks.

@phung.nguyen

Does this issue happen with takeScreenShot() keyword too?

Thanks for your feedback @duyluong.
We use only WebUI.takeFullPageScreenshot in our test case so far. Is there a known issue with WebUI.takeFullPageScreenshot? Is it recommended to use WebUI.takeScreenShot instead of?

Thanks for your advice.

I’m getting same error that @phung.nguyen describes, and it’s not happening for takeScreenshot() keyword as @duyluong asks.

Hi @phung.nguyen,

We tried to reproduce the bug on Katalon Studio Docker image: 8.2.0 many times but we haven’t seen it yet.
Could you please provide us the sample project which can cause this issue?

Regards,
Nam Nguyen.

Hi @nam.nguyen,

The page where we are taking the full screenshot contains a Json format data.
We found a workaround for the issue. Instead of taking the full page screenshot, we save the Json data into a file, it’s equivalent to a screenshot.

Sorry we can’t share the code because the test case needs access to our secured environment.

From our investigation we think that the error is due to the scrolled page for some reason.

I am closing that ticket.
Thanks for our support :slight_smile:

Phung

1 Like

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.