Writing to the Report

Top  Previous  Next

Purpose

You can write to individual columns, create columns, and add data to the report.

 

Usage

 

Writing to and Creating a Column

Use Tester.PushReportAttribute or Tester.SetReportAttribute to set values in specific rows. Tester.PopReportAttribute reverses the effect of Tester.PushReportAttribute:

 

PushReportAttribute

Tester.PushReportAttribute(columnNamevalue); 

 

...some test steps...        //the rows corresponding to these steps will have 

                               //value in their columnName column

 

Tester.PushReportAttribute(columnNamevalue2); 

 

...some test steps...        //the rows corresponding to these steps will have 

                               //value2 in their columnName column

 

Tester.PopReportAttribute(columnName); //test steps proceeding this will be back to value

If columnName does not exist, it will be added to the report.

 

SetReportAttribute

Tester.SetReportAttribute(columnNamevalue);

If columnName does not exist, it will be added to the report.  Column columnName will be populated with value for rows created after this function call (unless specified otherwise).

 

Adding Data

Data must be associated with an Assert row or a Message row.

 

Tester.Assert(description, expression, data, columnValuePairs)

Tester.Message(description, data, columnValuePairs)

 

description is a string.
expression is the Boolean expression that the assertion tests.
data is an array of data objects.  Each data element is written to its own row below the assert/message row with which it is associated.  Data can be text, a link, or an image.  The following is an array with text, link, and image data.

 

[        new SeSReportText(text),

       new SeSReportLink(urlStringlinkText),

       new SeSReportImage(ImageWrapperObject, imageDescription)

]

 

columnValuePairs is an object with key/value pairs.  Column names are the keys.  If the specified column does not exist, it will be created. Ex:

{requirement: "Req1.2.3", paragraph: "12.5"}

 

See Also

Automated Reporting
The test samples include a sample about reporting (Reporting.sstest)