When I tried the command below in CMD I can zip the folder: powershell Compress-Archive C:\Users.…\Reports\20210930_142534\Test\Login C:\Users.…\Reports\20210930_142534\Test\Login.zip
Kindly advice on how I can get this working, thank you so much
However these lines of code will not compress the folder during runtime. That’s just my observation since if I run the above code separately it can compress the folder.
Maybe someone can further explain why it behaves like that.
Also, my goal was to upload this zipped file somewhere if the Test Suite failed but I think its not feasible since the generation of report files will only happen at the end of the AfterTestSuite.
Regarding your Report capture:
The only way you can reasonably accomplish what you are trying to do is to create a second suite and run them both sequentially.
Suite One is your current suite which builds the report you want to archive.
Suite Two contains a single test case which performs the archive steps.
There are other ways to do this where you have only Test Suite One. But they involve you building your own reports and ignoring the Katalon reports. That would also mean pretty much everything in TestOps would be useless to you since I don’t think there is an API for you to commit your custom reports to TestOps.
Regarding your zip problem:
I don’t know what is wrong there. I issue commands and run batch files from my suites all the time and it works fine. My advice would be to have your .exec(...) do something very simple, prove it works, then introduce your Zip steps.
@Russ_Thomas the issue I encounter is, I cannot zip the report folder at AfterTestSuite during runtime. Although now that I saw the generation of reports is after my codes its pretty useless since its contains no report at that point. But if I zip other folders outside the report I’m currently running, compress command works.
Thanks for your inputs regarding the Report Capture. Will be assessing my options. Have a nice day
@kenneth.montevirgen just wrap your katalon execution into a script (powershell, batch, bash, whatever else, depending on your execution environment)
to do the zip and upload steps straight into the test project makes your test suite prone to errors.
the post-processing of the test results is to be independent of the test execution and should not fail the test if an error occur during the post-processing steps
this is the preferred way in any CI tool
Even i faced the same issue. We can zip the folder… but nothing inside the report folder since report generation is at last. I hope, if we can add report generation at after Test suite then it will be helpful.
The workaround of adding 2 test suite and then call the them as a test suite collection, that works for me. but still that is not a normal approach.
the normal approach is to post-process any report after the scope of the entire build ends.
this is valid also for maven and gradle builds or any other automated testing tool.
the reports are generated after the scope of the test suite ends, so you cannot process the reports until the scope of the build ends completely.
there I showed a demo how to zip a Report folder of a Test Suite. I applied what I call “Post TestSuite processing” approach: the output from a Test Suite is post-processed by a following Test Suite.