MHTML is written into /var, which is incovenient

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

  1. I have currently applied Katalon Studio in my project

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

  1. I can continue my job, but my performance is lower than expected

Operating System

  • macOS Big Sur 11.0.2

Katalon Studio Version

7.8.0

Katalon Studio logs

I do not think logs is necessary for this issue

Screenshots / Videos

In my project, WebUI.click() failed. Katalon Studio 7.8.0 produced a MHTML file. The file was saved under the /var directory.

MHTML is available at /var/folders/7m/lm7d6nx51kj0kbtnsskz6r3m0000gn/T/Katalon/Test Cases/test1/20201206_095417/Test-Cases_test1.mhtml

/var is inconvenient. I can not make use of the MHTML file.

The “Finder” tool of Mac hides the /var as default setting. So I can not make use of the MHTL file. If I want to, I have to change the OS setting somehow. Why KS writes the MHTML into /var?

And I think, it would be nice if KS writes a message with an embeded hyper link by which I can open the MHTL file with browser by a single click.

@kazurayam

The reason is that there isn’t a permanent folder dedicated for test case execution. If you go into that folder you’d see other temporary log files pertaining to a test case execution as well.

I am not sure what’s the difficulty in getting the MHTML here, in my Mac you can do this:

and then

It should take you to the folder. Or is there a setting you need to configure in order for this to work ? I am not sure.

OK, I understand it. Just I am not familiar with the Finder tool of Mac.

1 Like

On Windows, how does it work? Into which folder a MHTML file is written?

Similarly it’ll be written to a temporary folder. I am not sure about the exact location, but the path will also be generated by calling Files.createTemporaryFile.

Feature request:

With a browse button, of course :wink:

1 Like

I found a thing.

I enclosed a Test Case in a Test Suite and executed the TS. The TC failed. Then I found that Katalon Studio wrote a MHTML under the <projectDir>/Reports.

As far as I execute a Test Case enclosed in a Test Suite, the MHTL is written in the project directory, not /var. It’s good.

I would prefer MHTML files are written into some directory under the <projectDir> with a fixed file path. Why? I want to locate the MHTL file, open it with a browser to have a look into it using Browser-built-in DevTools. I may repeat this operation dozens of times until I could fix my silly bugs. I want to automate this MHTML-backed reproduction operation.

So, I would like to write a test case script. This worker script will do a super simple thing — locate the path of MHTML file and open it in browser. To write this script I need the path of MHTML file is fixed, without any randomised string in the path. When a Test Case is executed enclosed in a Test Suite, MHTL is written into the path like:

  • Reports/20201207_072704/xxxx/20201207_072704/Test-Case_test1.html

This path is OK. I can write a script that is aware of this path.

However when a Test Case is executed naked without enclosing Test Suite, MHTL is written into the path like:

  • /var/folders/7m/lm7d6nx....

I can not write a Test Case script that opens the MHTML file in browser. Let me propose an idea. Katalon Studio can create an anonymous directory _ under the <projectDir>/Reports where it writes MHTL files when TC is executed naked. The path should be fixed like:

  • <projectDir>/Reports/_/Test-Case_test1.html

This file will be overridden next time, will be lost. ---- That’s OK. I don’t mind it. When I execute the TC next time, I am no longer interested in how it ran previously.

1 Like

@ThanhTo

Why not KS opens MHTML file automatically soon after generating it so that a user can start debugging soon without wondering how to open the MHTML file. A new option of Project>Execution settings, probably. If this option is offered, MHTML in the /var directory would be no longer problematic.

1 Like

@kazurayam @Russ_Thomas

Currently, when a test case fails due to broken locators, a link that opens Time Capsule is available in the Log Viewer when you click on the name of the Test Case.

I wonder if this helps speed up your process, and do you think adding a setting to open Time Capsule automatically would still be better ? Also, is the text “Click here to fix broken Test Object” relevant to the context in which you want to use Test Object ?

Well, I didn’t see it.

For example in the folloing log, I do not find a “Click here” link.

2020-12-07 14:21:11.782 DEBUG testcase.test1                           - 16: click(findTestObject("Page_Sales Funnel - TexasLending.com/img_How did you hear about us_vc_single_ima_7c4a04"))
2020-12-07 14:21:12.574 ERROR c.k.k.core.keyword.internal.KeywordMain  - ❌ Unable to click on object 'Object Repository/Page_Sales Funnel - TexasLending.com/img_How did you hear about us_vc_single_ima_7c4a04' (Root cause: com.kms.katalon.core.exception.StepFailedException: Unable to click on object 'Object Repository/Page_Sales Funnel - TexasLending.com/img_How did you hear about us_vc_single_ima_7c4a04'
	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.ClickKeyword.click(ClickKeyword.groovy:76)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:43)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:73)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:617)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$1.call(Unknown Source)
	at test1.run(test1:56)
	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:393)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:384)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:363)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:355)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:251)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
	at TempTestCase1607318441376.run(TempTestCase1607318441376.groovy:25)
Caused by: org.openqa.selenium.ElementNotInteractableException: element not interactable
  (Session info: chrome=87.0.4280.88)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'KAZUAKInoAir.AirPort', ip: 'fe80:0:0:0:1888:cede:7da8:3903%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.16', java.version: '1.8.0_181'
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 87.0.4280.88, chrome: {chromedriverVersion: 87.0.4280.88 (89e2380a3e36c..., userDataDir: /var/folders/7m/lm7d6nx51kj...}, goog:chromeOptions: {debuggerAddress: localhost:49483}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:virtualAuthenticators: true}
Session ID: 5f0f1689bc8473ae239ee26e92b2aaa4
	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)
	at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:285)
	at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:84)
	at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.lambda$new$0(EventFiringWebDriver.java:404)
	at com.sun.proxy.$Proxy11.click(Unknown Source)
	at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.click(EventFiringWebDriver.java:417)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:69)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.call(ClickKeyword.groovy)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.click(ClickKeyword.groovy:76)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:43)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:73)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:617)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$1.call(Unknown Source)
	at Script1606987724779.run(Script1606987724779.groovy:56)
	... 11 more
)
2020-12-07 14:21:12.585 ERROR c.k.katalon.core.main.TestCaseExecutor   - ❌ Test Cases/test1 FAILED.
Reason:
com.kms.katalon.core.exception.StepFailedException: Unable to click on object 'Object Repository/Page_Sales Funnel - TexasLending.com/img_How did you hear about us_vc_single_ima_7c4a04'
	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.ClickKeyword.click(ClickKeyword.groovy:76)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword.execute(ClickKeyword.groovy:43)
	at com.kms.katalon.core.keyword.internal.KeywordExecutor.executeKeywordForPlatform(KeywordExecutor.groovy:73)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords.click(WebUiBuiltInKeywords.groovy:617)
	at com.kms.katalon.core.webui.keyword.WebUiBuiltInKeywords$click$1.call(Unknown Source)
	at test1.run(test1:56)
	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:393)
	at com.kms.katalon.core.main.TestCaseExecutor.doExecute(TestCaseExecutor.java:384)
	at com.kms.katalon.core.main.TestCaseExecutor.processExecutionPhase(TestCaseExecutor.java:363)
	at com.kms.katalon.core.main.TestCaseExecutor.accessMainPhase(TestCaseExecutor.java:355)
	at com.kms.katalon.core.main.TestCaseExecutor.execute(TestCaseExecutor.java:251)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:114)
	at com.kms.katalon.core.main.TestCaseMain.runTestCase(TestCaseMain.java:105)
	at com.kms.katalon.core.main.TestCaseMain$runTestCase$0.call(Unknown Source)
	at TempTestCase1607318441376.run(TempTestCase1607318441376.groovy:25)
Caused by: org.openqa.selenium.ElementNotInteractableException: element not interactable
  (Session info: chrome=87.0.4280.88)
Build info: version: '3.141.59', revision: 'e82be7d358', time: '2018-11-14T08:25:53'
System info: host: 'KAZUAKInoAir.AirPort', ip: 'fe80:0:0:0:1888:cede:7da8:3903%en0', os.name: 'Mac OS X', os.arch: 'x86_64', os.version: '10.16', java.version: '1.8.0_181'
Driver info: com.kms.katalon.selenium.driver.CChromeDriver
Capabilities {acceptInsecureCerts: false, browserName: chrome, browserVersion: 87.0.4280.88, chrome: {chromedriverVersion: 87.0.4280.88 (89e2380a3e36c..., userDataDir: /var/folders/7m/lm7d6nx51kj...}, goog:chromeOptions: {debuggerAddress: localhost:49483}, javascriptEnabled: true, networkConnectionEnabled: false, pageLoadStrategy: normal, platform: MAC, platformName: MAC, proxy: Proxy(), setWindowRect: true, strictFileInteractability: false, timeouts: {implicit: 0, pageLoad: 300000, script: 30000}, unhandledPromptBehavior: dismiss and notify, webauthn:virtualAuthenticators: true}
Session ID: 5f0f1689bc8473ae239ee26e92b2aaa4
	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)
	at org.openqa.selenium.remote.RemoteWebElement.execute(RemoteWebElement.java:285)
	at org.openqa.selenium.remote.RemoteWebElement.click(RemoteWebElement.java:84)
	at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.lambda$new$0(EventFiringWebDriver.java:404)
	at com.sun.proxy.$Proxy11.click(Unknown Source)
	at org.openqa.selenium.support.events.EventFiringWebDriver$EventFiringWebElement.click(EventFiringWebDriver.java:417)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.doCall(ClickKeyword.groovy:69)
	at com.kms.katalon.core.webui.keyword.builtin.ClickKeyword$_click_closure1.call(ClickKeyword.groovy)
	at com.kms.katalon.core.webui.keyword.internal.WebUIKeywordMain.runKeyword(WebUIKeywordMain.groovy:20)
	... 17 more

2020-12-07 14:21:19.258 INFO  .k.c.e.TestExecutionSocketServerEndpoint - MHTML is available at /var/folders/7m/lm7d6nx51kj0kbtnsskz6r3m0000gn/T/Katalon/Test Cases/test1/20201207_142041/Test-Cases_test1.mhtml
2020-12-07 14:21:19.267 INFO  c.k.katalon.core.main.TestCaseExecutor   - END Test Cases/test1

Yes, it helps if the link is available.

But are you sure that the “Click here to fix broken Test Object” link is displayed in all cases? There would be possibly hundreds of cases where a StepFiledException is thrown, in all these cases, will KS surely emit the link in message? The above stacktrace proves not.

It would be an idea to reformat the following message to have a clickable link

@kazurayam

The Log Viewer parses the location of the MTHML file and displays the link. It isn’t a hyperlink in the stack trace per-se. You can see that the Log Viewer also extracts the root cause of the current stack trace of the test case.

This is a nice idea !

I have a question. As I understand it, you want to access to Time Capsule as you attempt multiple times to fix the bugs. After an attempt, you would execute the test again, and access the Time Capsule.

The question is: wouldn’t it be more efficient to use Run from here after you fix your test ?

When the test fails, leave the browser on, fix the test, and then press Run from here.

Or is there a more particular reason you’d like to use Time Capsule for this job.

I don’t know what it is.

I never use Manual mode. Manual mode is not something I’d like to get familiar with. I can not understand any software without looking at source code as plain text.

I only use Script mode and this button GreenArrowButton.

1 Like

i find MHTML is not very useful for me, so am no longer interested in it.