Header

Skip to end of metadata
Go to start of metadata

You are viewing an old version of this page. View the current version.

Compare with Current View Page History

Version 1 Next »

Qualitia supports Jenkins, an open source automation server written in Java. It is a cross-platform, continuous integration, and continuous delivery application that increases your productivity. 

You can integrate Qualitia to execute test cases through Jenkins. In order to do so, you must configure your offline package accordingly.  

Jenkins Installation

Jenkins can be installed using following two methods. However, Qualitia recommends to install Jenkins using the war file.

 Installing Jenkins Using war File (Recommended)
  1. Download Jenkins and JRE 6, 7/JDK 1.6, 1.7.
  2. Install JRE 6, 7/JDK 1.6, 1.7.
  3. Do one of the following:
    1. If Java_Path is not added as Enviornment Variable: Open the Command Prompt window, navigate to the folder where you have downloaded JRE 6, 7/JDK 1.6, 1.7,  and then navigate to the folder where you have downloaded Jenkins. 
    2. If Java_Path is added as Enviornment Variable: Open the Command Prompt window and navigate to the folder where you have downloaded Jenkins. 
  4. Execute the following command:
     java -Dhudson.model.DirectoryBrowserSupport.CSP="default-src 'self';img-src 'self'; style-src 'self' 'unsafe-inline'; child-src 'self'; frame-src 'self'; script-src 'self' 'unsafe-inline'; frame-ancestors 'self';" -jar jenkins.war.
    Default port is 8080.

    After successful execution of command, a message is displayed confirming Jenkins installations in the Command Prompt window.
  5. Open URL: http://localhost:8080.
    This launches Jenkins' dashboard.

On this page:

 Installing Jenkins as a Service
  1. Install JRE 6, 7/JDK 1.6, 1.7.
  2. Download and Install Jenkins following the onscreen instructions.
  3. Once the installation process is completed, open the location where Jenkins is installed. 
  4. Open the jenkins.xml.
  5. Update the argument for %Base%\jre\bin\java as follows:
    -Dhudson.model.DirectoryBrowserSupport.CSP="default-src 'self';img-src 'self'; style-src 'self' 'unsafe-inline';
    child-src 'self'; frame-src 'self'; script-src 'self' 'unsafe-inline'; frame-ancestors 'self';"
    (warning) Do not remove the existing value. Just add to the existing value as displayed in the image above.
     View Image
  6. Save and close the file.
    (info) Restart the Jenkins service once you update the XML values from the Services.msc console.

Jenkins Configuration

Once you have installed Jenkins, you can proceed for Jenkins configurations.

  1. Launch Jenkins (http://localhost:8080).
  2. Enter the Administrator password.
    Take the Administrator password from the initialAdminPassword file located in the .jenkins\secrets folder.
  3. Click Continue.
  4. Jenkins asks to install plugins. Skip to install plugins for now clicking the X icon from the top right corner of the window and click Start using Jenkins button.
  5. Go to Jenkins > Manage Jenkins > Manage Plugins.


  6. Access the Available tab.
    A list of available plugins is displayed to select and install.
  7. Select HTML Publisher, Email Extension, Environment File, and Environment Injector plugins.
  8. Select Subversion plugin, if your test execution XML exists in subversion server. 
  9. Click Install without Restart.
    Post successful installation; go to the Jenkins' dashboard.
  10. Click New Item.
  11. Enter the item name, select Freestyle project, and then click OK.
    You are navigated to new job configuration page.
  12. In the Build section, click Add build step and then select Execute windows batch command.
  13. In the Command text box, enter the command to execute qualitia-offline.xxxx.jar.
    For example: If your offline package is stored in the D > OfflinePackage, enter the command to navigate to the D drive and then command to execute the offline package.

    d:
    cd "D:\OfflinePackage"
    java -jar qualitia-offline.xxxx.jar

  14. Click Add Build Step and select Inject environment variables.
    Note: This step has to be followed by step 12; otherwise Qualitia Reports will not be visible through Jenkins.
  15. Update Properties File Path for the file qer.properties along with the file name.
    This file is located in the Offline Package. For example: <Offline Package location>\qer.properties.
    Note: The qer.properties file is generated after running the first Jenkins job only.
  16. In the Post-build Actions section, click the Add Post build action button and select Publish HTML reports.
  17. In the Publish HTML reports section, enter the values as mentioned below:
    1. HTML directory to archive: $qualitiareportpath
    2. Index page[s]: $reportfilename
    3. Report title: Qualitia Report
    4. Select the Keep past HTML reports check box.
  18. Click Save.
  19. On the top left corner of the screen, click Jenkins > Manage Jenkins > Configure System.
  20. In the E-mail Notification section, click the Advanced button and fill up the information that includes;
  • SMTP server,
  • Default user e-mail suffix,
  • Select the Use SMTP Authentication check box,
  • Enter User Name,
  • Enter password,
  • Select the Use SSL check box,
  • SMTP port,
  • Reply-To Address, and
  • Charset

Below is an example for reference.

21. Select the Test configuration by sending test e-mail check box, update the e-mail address and click Test Configuration.
System notifies in case of any errors. Recheck the settings in case of any errors. Refer to the screenshot below for correct values of Extended E-mail Notification section.


Note: Multiple email addresses can be added by separating them using ','. Subject and content of the email can be changed as per your company requirements.

22. Click Save.

23. To enable this email notification for any project, from Jenkins' dashboard, click the project name and click Configure in the left pane.

24. In the Post Build Actions section, click Add post-build action and select Editable Email Notification.

25. Click Advanced Settings button.

26. Click the Add Trigger button and select the status from the list for which you wish to get notifications.

27. Select the status for which you wish to receive the email notifications.

28. Click Save.

Execute and View Report

Once all the settings are configured successfully, you can proceed to execute the test cases and view reports respectively.

  1. Access Jenkins' dashboard.
  2. Click the down arrow near project name and then click Build Now.

 
You can view the complete build history in the left pane under Build History.

  • User will also see execution of the Test Cases involved in the Offline Package.
  • Once the build is successfully generated, click > Qualitia Report.
  • Qualitia Offline Package execution report is displayed in the browser.

  • User can view earlier reports by selecting the respective Build and going to Qualitia Report of that build.
  • User can click on the zip link to download the zip of the Qualitia Report folder/files.

If you are unable to view the report, refer to Unable to view Qualitia Suite Execution Summary Report in Jenkins.

Parallel Execution with Jenkins

The Parallel Execution approach works on Linux. You need to install plugins mentioned below that help in executing test cases.

Once both the plugins are installed,

  1. Create a job with a suitable name. For example: Smoke_Suite.
  2. Select "Build Flow" from the options and click Ok. It takes you to the Configure section of the Build Flow plugin.
  3. Go to Build Triggers and add your script as mentioned below;

parallel(
{build("Smoke_Firefox")},
{build("Smoke_chrome")}
)

In the example above,
"Smoke_Firefox" and "Smoke_chrome" are qualitia offline jobs that are configured to execute on Firefox and Chrome respectively. You can build multiple complex flows using this plugin. Please go through the Build Flow plugin URL to explore further.
Configuring Qualitia Offline Job
In order to run parallel executions, you need to configure Qualitia offline jobs accordingly. Once jobs are configured,

  1. Open the project configuration and select the Start Xvfb before the build, and shut it down after check box.
  2. In the Execute Shell text box under the Build section, run the qualitia.offline.jar. Refer to the command mentioned below.
cd /home/qualitia/QualitiaOffline
java -jar qualitia-offline-x.x.x.jar smoke.propertiessbrowsertype=googlechrome ScreenCaptureMode=BROWSER

It is recommended to keep the ScreenCaptureMode as BROWSER when running parallel executions.
Execute Tests in Parallel
Once offline jobs and respective settings are configured successfully, you can execute tests in parallel executing the Build Flow accordingly. As per the example mentioned above, this executes both "Smoke_Firefox" and "Smoke_Chrome" concurrently.
Once execution is completed, you can go to reports on the build flow job and check the results.

Configuring Offline Package to Push Results into the Report Database

You can configure the offline package to push the test execution reports into the report database after the test suite execution. This eliminates the manual process of importing offline package execution results in Qualitia automation studio (Reports section).

Importing these reports automatically into the automation studio will also enable Qualitia user to view test execution results from the web-based dashboards.

Prerequisites:

  1. In order to push results, the machine which you are using to trigger the test case execution must have access to the machine where Qualitia Server is installed.
  2. You must have access to port 8887 from the machine where Qualitia Server is installed.

To configure Qualitia offline package to push results into the report database:

  1. Open the extracted Qualitia Offline folder of the associated offline package.
  2. From the Config Utility folder, open the Qualitia Offline Configuration Manager.
  3. On the Setting tab, enter the Qualitia Server URL address.

  • No labels