Page tree
Skip to end of metadata
Go to start of metadata

void Report(String remark, boolean status)

Or:

void Report(String pathToImage, String remark, boolean status)

Notes:   

  1. This command is available only from a coding environment;
  2. In VB, Python, Perl and Ruby clients, the second variation of this command is called: reportWithImage;
  3. In VUGen client, the variations of this command are called ic_report and ic_report_with_image, respectively, and their extra first argument is a pointer to the client structure.

Supported in iOS Supported in Android

Description

This command enhances the reports generated after test runs.

A standard report contains a line for each execution step. This command allows to customize the report by presenting meaningful information for a specific step (or a set of steps). This information can consist of a custom remark and/or an image.

Parameters

  • pathToImage: The path to the image to be displayed in the entry of the current step when a report is generated. The path can be either a full local path or a URL.
    The supported URL protocols are the following:
    • file://
    • http://
    • https://
  • remark: The custom remark; if the value of this argument can be parsed as a valid URL to an image, then this image will be integrated into the generated report.
  • status: boolean
    • True:The specific step will be marked as passed.
    • False: The specific step will be marked as failed.

Usage

Example Script: Report with a textual remark

Scenario: In this example, we will call command Report with a textual remark in a JUnit test:

 

Java Example
client.report("This is a custom message inserted into the test report. It will be marked there as \"failed\"", false);
C# Example
client.Report("This is a custom message inserted into the test report. It will be marked there as \"failed\"", false);
VUGen Example
ic_report(&client, "This is a custom message inserted into the test report. It will be marked there as \"failed\"", IC_FALSE);
Python Example
self.client.report("This is a custom message inserted into the test report. It will be marked there as \"failed\"", False)
Perl Example
$client->report("This is a custom message inserted into the test report. It will be marked there as \"failed\"", 0);

Result: As a result, the following step will appear in the report when a report of the test is generated:

Note: The step is marked as failed owing to value false passed as the second argument (status). If a device has been set as active and its screenshot is available, the screenshot will be attached to the step report.

Example Script: Report with a custom image given as URL

Scenario: In this example, we will call the ReportWithImage command with a URL to a custom image in a test written in Python:

 

Java Example
client.report("https://pp.vk.me/c11102/u167537414/-6/w_8fbae648.jpg", "This message will be displayed with a custom image referenced by URL", true);
C# Example
client.Report("https://pp.vk.me/c11102/u167537414/-6/w_8fbae648.jpg", "This message will be displayed with a custom image referenced by URL", true);
VUGen Example
ic_report_with_image(&client, "https://pp.vk.me/c11102/u167537414/-6/w_8fbae648.jpg", "This message will be displayed with a custom image referenced by URL", IC_TRUE);
Python Example
self.client.reportWithImage("https://pp.vk.me/c11102/u167537414/-6/w_8fbae648.jpg", "This message will be displayed with a custom image referenced by URL", True)
Perl Example
$client->reportWithImage("https://pp.vk.me/c11102/u167537414/-6/w_8fbae648.jpg", "This message will be displayed with a custom image referenced by URL", 1);

Result: The first argument can be parsed as a valid image URL. As a result, the following step will appear in the report when a report of the test is generated:

Note: The step is marked as successfully passed owing to value True passed as the third argument (status).

Example Script: Report with a custom local image

Scenario: In this example, we will call command Report with a URL to a custom local image in a C# NUnit test:

 

Java Example
client.report("C:\\Day_3\\IMG_20150210_114707.jpg", "This message will be displayed with a custom local image", true);
C# Example
client.Report("C:\\Day_3\\IMG_20150210_114707.jpg", "This message will be displayed with a custom local image", true);
VUGen Example
ic_report_with_image(&client, "C:\\Day_3\\IMG_20150210_114707.jpg", "This message will be displayed with a custom local image", IC_TRUE);
Python Example
self.client.reportWithImage("C:\\Day_3\\IMG_20150210_114707.jpg", "This message will be displayed with a custom local image", True)
Perl Example
$client->reportWithImage("C:\\Day_3\\IMG_20150210_114707.jpg", "This message will be displayed with a custom local image", 1);

Result: The first argument can be parsed as a valid image URL. As a result, the following step will appear in the report when a report of the test is generated:

Note: The step is marked as successfully passed owing to value true passed as the third argument (status).

  • No labels