Skip to main content
Daria
Head of Community
Jul 21, 2023 4:07 PM UTC

Creating Report Log on Tosca for RPA Team When Process Fails

Hi,

This is more of a sharing post than anything. I hope my way of achieving a reportlog will be helpful to anyone who's looking to create something similar. If you've another approach, do drop them in the comment so we can learn from one another in this community.

Before I begin, reportlog is a useful document for Error Identification and Troubleshooting. The report log is supposed to document each step performed by Tosca and if an error is encountered, it should document it. Another point is Auditing. Since Tosca is an automation tool, the VM running it has access to certain sensitive data such as customer information and financial reports. These are all sensitive documents with lots of manual processes automated by Tosca. Hence, this reportlog will serve as a transparent logging system of tasks that are performed during the execution.

In Preprocessing

- The first step is to create a datetime buffer. This logs the date and time which represent the time in which the execution list has been started. This is achieved by "TBox Set Buffer" with the name being "DatetimeBuffer", value being "{datetime}", ActionMode being "Input" and DataType being "String". This {B[DatetimeBuffer]} can be used to create any documents at a later stage to ensure it will always be unique.

- Now, I will create the reportlog textfile using "TBox Append File". After selecting a reportlog folder in my working directory, the file name can be "reportlog-{B[DatetimeBuffer]}.txt. The text could be:

.HTML====== REPORT LOG =====
There are currently 37 processes for a completely successful run.
{DATE} {TIME} [INFO] 1. ReportLog successfully created.

Choose the naming convention for your reportlog and follow them subsequently. For instance, when it is a successful task, it will be labelled [INFO] else it will state [ERROR].

In Process

- After each teststep, add a "TBox Append File" and select back the same reportlog file. It should append a new line with the text being:
{DATE} {TIME} [INFO] 2. Process of website registration completed.

- When there are several ways of how the testcase can go, you can add a IF statement. If website registration is completed it should append the above, else it should append the below log:

{DATE} {TIME} [ERROR] 2-AF. Process of website registration failed.

In Postprocessing

- Create a mailserver and upload the reportlog to the RPA team. You can also save these reportlog files in a folder for auditing.

Alternative Solution Using TCShell:

task "Print Report ... ExecutionEntries with ActualLog" "C:/Users/SuperMario/Desktop/example.pdf"

More information can be found at https://support-hub.tricentis.com/open?id=kb_article_view&sys_kb_id=35ac10a5376e2a84406642f643990e26.

    1 reply

    Community Manager
    Jul 21, 2023 4:07 PM UTC

    I can see how this would work, but this sounds like a huge additional effort to maintain an additional logging step for every single test step that is written, or even a subset of them.
     

    Have you explored other out of the box capabilities, e.g. using the Tosca Execution Client (or CI Client in older versions to trigger the tests and output the results as JUnit XML?