How to Automatically Attach Module-wise Reports to Emails Via Jenkins

Modified on Thu, 29 Aug at 11:04 AM

1. Overview 

1.1. Configuring Application Settings file

1.2. Generating Reports Module-wise and Attaching them to Emails

1. Overview 

After script execution, the reports generated will be attached to the recipient's email automatically to generate module-wise reports.


1.1. Configuring Application Settings file

To address this, perform the following:

  1. algoQA scripts generated follow an organized folder structure. Search and locate the ApplicationsSettings.XML file. Copy and paste the ApplicationsSettings.XML file to the location where POM and Report.exe files are located.
  2. In the ApplicationSettings file, update the 'To email',  'From Email' and 'From Password' parameters as shown in the following example screenshot.
    For example, you can find Applications.XML file in an algoQA script generated folder for a web automation available at - ScriptGeneration_202310311222.zip\AlgoAFScript_202310311222\src\test\java.


1.2. Installing Mono on Ubuntu 

  1. If you are unable to generate the reports module-wise and attaching them to recipient emails in Jenkins hosted on AWS using the following command, you can use Mono as an alternative platform to execute the report command.
    algoReport.exe JUnitSpark ModuleWise "output folder path" projectName
    In the preceding command,
    replace "output folder path" placeholder with the actual path where the generated report files will be saved. 
    replace 'projectName' with the name of the project for which the report is being generated.
  2. Mono is an open-source platform for running and developing cross-platform applications.
    Perform the following to install the Mono runtime on an Ubuntu system. 
    1. Login as root user. Ensure you have root privileges to install packages and modify system configurations.
    2. Run the following command to install prerequisites:
      sudo apt install ca-certificates gnupg
      ca-certificates : Installs a set of CA certificates to ensure secure connections.
      gnupg: Installs GNU Privacy Guard (GPG), a tool for secure communication and data storage, necessary for handling cryptographic keys.
    3. Run the following command to add the Mono GPG key:
      sudo gpg --homedir /tmp --no-default-keyring \
      --keyring /usr/share/keyrings/mono-official-archive-keyring.gpg \
      --keyserver hkp://keyserver.ubuntu.com:80 --recv-keys             3FA7E0328081BFF6A14DA29AA6A19B38D3D831EF
    4. Run the following command to add the Mono repository:
      echo \ deb [signed-by=/usr/share/keyrings/mono-official-archive-keyring.gpg] https://download.mono-project.com/repo/ubuntu stable-focal main" | \
      sudo tee /etc/apt/sources.list.d/mono-official-stable.list
    5. Run the following command to update the package list:
      sudo apt update
      This command updates the list of available packages and their versions from the newly added Mono repository.
    6. Install Mono:
      sudo apt install mono-complete mono-dbg -y
      - mono-complete: Installs the complete Mono runtime and development environment.
      - mono-dbg: Installs debugging tools for Mono.
      - -y : Automatically answers "yes" to any prompts during the installation.
    7. Run the following command to verify Mono installation:
      mono -V
      This command displays the version of Mono installed, verifying that the installation was successful.
      The preceding commands ensure that Mono is installed and configured on your Ubuntu system.

    8. Repeat the step 1 to attach the report to the recipient emails module-wise, as shown: 


Note: In this report, test cases are organized by module. For example, the TC_Filter module includes 21 test cases, each named sequentially from TC_Filter_01 to TC_Filter_21. Similarly, the TC_Cart module and other modules follow the same naming convention. These names are assigned during recording of a scenario using the Follow Me feature. The report consolidates and lists all test cases under their respective module tags, such as TC_Filter and TC_Cart.


 




Was this article helpful?

That’s Great!

Thank you for your feedback

Sorry! We couldn't be helpful

Thank you for your feedback

Let us know how can we improve this article!

Select at least one of the reasons
CAPTCHA verification is required.

Feedback sent

We appreciate your effort and will try to fix the article