
Gearbox also released a FAQ, so I think we have enough to make this thread now. My materialstore project addresses this problem.Game Informer has been pretty good about putting up a significant amount of content on their site already, and it sounds like most of the rest of the magazine content will be up there soon. How can we store a screenshot into a file while retaining the metadata such as the source URL associated with the file?

Here we find another challenge in saving screenshot as file. We can not use the character / in file name on any OS - Windows, Mac, Linux. Then, wouldn’t it be nice if we could save a screenshot into a file with a name just the same as the source URL ? like this:Īs we all know, this is impossible. Therefore the file foo.png can not be reused. But another script would never be informed that foo.png was created out of. My script may name the screenshot of URL as foo.png. I named screenshot image files as foo.png, bar.png, baz.png.
#Battleborn screenshot path how to
The TL1 an TC3_reportFolder_baz.png shows you how to save a screenshot into Katalon’s “Reports” folder. Thefore the reportFolder is given with a harmless value. This is because Katalon Studio creates a “Report” only for a Test Suite it does not create “Report” for a Test Case. When you choose a Test Case, the reportFolder will have a path of temporary directory. Please remark the difference how the reportFolder property is set when you ran the Test Case (not the Test Suite). 11:30:57.233 INFO c.k. - START Test Cases/TC3_reportFolder_baz.png On the other hand, when you choose the Test Case TC3_reportsFolder_baz.png and run it, you will see the following messages.

11:27:09.670 INFO c.k. - START Test Cases/TC3_reportFolder_baz.png projectDir =/Users/kazuakiurayama/katalon-workspace/KS_saving_screenshots_into_the_folder_you_want 11:27:09.118 INFO c.k. - START Test Suites/TS3_reportFolder_baz.png When you run the Test Suite TS3_reportsFolder_baz.png, you will see the following messages in the Console.

How reportFolder is set when you run Test Case KS does not display any unknown files in the Reports folder. Katalon Studio does not expect users to save arbitrary files in the Reports folder. However, you can never see the baz.png file in the Reports in the Katalon Studio GUI. When you run the Test Suite TS3_reportFolder_baz.png, will see a file baz.png is created in the Reports folder. Path pngFile = reportFolder.resolve("baz.png") Path reportFolder = Paths.get(TL1.reportFolder) // Test Listener/TL1 is constructed by Katalon Studio before this test case script runs Then your Test Case TC3_reportFolder will refer to the reportFolder property of TL1 object. The TL1 object sets an appropriate value into the reportFolder property using RunConfiguration.getReportFolder() method. Katalon Studio always instantiate the TL1 class before your Test Suites and Test Cases are activated. Please note that the TL1 has a static property named reportFolder. The following is the simplest example of using the built-in keyword WebUI.takeScreenshot(String fileName). I will show you some sample codes step by step. Then your Test Case scripts would be able to control where to save the screenshot images into the folder you want. You want to use these API in a Test Listener.

Katalon Studio provides a set of built-in keywords as documented in the “Capture Screenshots”.
