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

SetReporter(reportType, ReportPath, testName) 

Notes: 

  • This command can only be added in the code environment (except UFT), and not in SeeTestAutomation.
  • In Python and Perl the command is called setReporter2. In Python, for example, the command can be used this way:

    self.client.setReporter2("xml", "reports", "ReportName")

Description: 

This method will generally be called at the beginning of each test case, and it's configuration will define the report that will be generated at the end of the test. This command should be joined by the GenerateReport command to generate the report.

 Parameters:

  • Report TypeFormat of the generated report.
  • Report Path: Path where the report and all its content will be stored. The default path in Windows is C:\Users\<User name>\seetest-reports\ folder.
  • Report Name: Will be the name given to the report in the Report summary page.


Report Type Options

Below is a list of values that can be set as the report type

Name

Description

html / screenshotGenerates the Screenshots based report (External Report)
videoGenerates video for the report. 
xmlGenerates both the Screenshots based report (External Report) and the  video report.
propertiesGenerates a report properties file
pdfGenerate a pdf report
dummy

creates an empty report

Set dummy reporter when using custom reporters (not for SeeTest Reporter). If the dummy reporter was set, Report Path and Report Name should be set as empty strings (" ").

Video generation

  • In order for video to be generated, video should be enabled in <Cloud Installation folder>\Server\conf\cloudserver.conf.xml
  • Video is only available for Grid

Input

  • 'pdf' report type behavior was changed in 20.4 to only generate a PDF report file. Replace with "pdf,video" to preserve old behavior.
  • 'xml' will have the same behaviour as "html,video"
  • The properties file is also included by the html report.
  • Type string is whitespace and case sensitive

Example A:

For Java Junit framework it will usually be a part of the @Before section as all other operation needed before the actual test starts.


@Before
    public void setUp(){
        client = new Client(host, port, true);
        client.setProjectBaseDirectory(projectBaseDirectory);
        client.setReporter("xml", "reports", "Test 2");
    }

Parameters:

  • Report Type: will be set to “xml” (for web display)
  • Report Path: will be set as “reports” which means the default location
  • Report Name: Will be set to “Test 2”

Example B:

@Before
    public void setUp(){
        client = new Client(host, port, true);
        client.setProjectBaseDirectory(projectBaseDirectory);
        client.setReporter("pdf", "c://Temp//Pdf-reports", "Test 3");
    }

Parameters:

  • Report Type: will be set to “pdf”
  • Report Path: will be set as "c://Temp//Pdf-reports"
Note: It should be an existing folder, otherwise, command will fail.
  • Report Name: Will be set to “Test 3”

Non-English characters on the pdf report

To handle non-ASCII characters in your PDF reports, you should apply  the following actions:

  • On Windows:
    1. If all the necessary true-type-font files (with extension .ttf) are located in %windir%/Fonts, you need to do no additional actions; your PDF report is to be normally rendered;
    2. If there are additional true-type-font files needed which are not located in %windir%/Fonts, do the following:
      1. In the application data directory (%appdata% on Windows), enter directory seetest, and create directory pdf there;
      2. Place the necessary true-type-font file(-s) there.
  • On OS-X:
    1. If all the necessary true-type-font files (with extension .ttf) are located in either $HOME/Library, or /System/Library, or /Library, you need to do no additional actions; your PDF report is to be normally rendered;
    2. If there are additional true-type-font files needed which are not located in any of the aforementioned directories, execute steps 2.1 and 2.2 of the Windows section.

Having done this, you can restart SeeTestAutomation, and PDF reports must be normally displayed.

  • No labels