Copying test results in the form of files to your test result directory can be automated.
Imagine the following scenario: your application interacts with certain files, and those files change from test to test. For logging purposes, you want to export the files to your test directory. Additionally, the attached file will also be visible in the test report.
Add test.attachFile(“/Path/to/folder/MyAddresses.adr”) to your script:
... test.compare(table.rowCount, 125) test.attachFile("/Path/to/folder/MyAddresses.adr") activateItem(waitForObjectItem(names.address_Book_MyAddresses_adr_QMenuBar, "File")) ...
(The code for this example can be found in squish/examples/qt/addressbook/suite_py/tst_general).
This will result in the copy of “MyAddresses.adr” to the result directory.
With the option
--resultdir for the squishrunner you can further specify the direction to copy your reports and attached files to.
In the IDE, you find the option to set the result directory under:
Edit > Preferences > Squish > Logging
Find more information about attachFile in our documentation.
For more information about Squish, visit https://www.froglogic.com/squish/