1/28/2024 0 Comments Noda screenshot pathHowever, 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. .configuration.RunConfiguration getReportFolder()..configuration.RunConfiguration getProjectDir().Katalon Studio API provides several classes + methods that helps to manage the location of PNG files as screenshot. I need to find out the folder path somehow. Therefore I can not write the folder names as a constant string literal in the script. As you know, the /Reports/20220312_100912 folder is created by Katalon Studio dynamically. Then, how can I save the PNG file into a specific location? For example, I want to create /Reports/20220312_100912/baz.png. The path can be an absolute or relative path. For example, the document of WebUI.takeScreenshot() writes:Ī String that represents the path to the saved image. It does not describe enough “how to manage the location of png files”. The doc describes only “how to take screenshots”. Katalon Studio provides a set of built-in keywords as documented in the “Capture Screenshots”.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |