You can add custom statistics to the Summary Results test report.

 

Best if used in the After Test script section and after the statistic values have been updated.

 

When called, this function will add one of more new user defined statistics to the Custom Statistics section.  Placements in the Summary Results report is towards the end the report, and just above any System Parameter Settings.  

 

User added Custom Statistics can be sorted.

 

Syntax:

test.AddStatistic( statisticName, value, [decimal places], [type] )

 

Parameter:

Description:

statisticName

String that names the added statistic

value

Value of that statistic

[decimal places]

Optional number of decimal places for display of float numbers. Default is 2 if left out

[type]

Places is still optional. Float is default, although if value is a string the String type is assumed.

 

Type Options:

Description:

"Integer"

Prints as an integer, truncated.

"Float"

Prints as a floating point number, default.

"Decimal"

Prints as a decimal, multiplied by 100 and a % added.

"Currency"

Prints as a comma delimited number with currency symbol prefixed.

"Date"

Prints as a date string YYYY-MM-DD.

"String"

Prints as a string. Must be a string, cannot be a number.

 

Example:

test.AddStatistic( "Adjusted MAR", 2.12345 )               ' Output is 2.12
test.AddStatistic( "My Custom Stat", 2.12345, 3 )         ' Output is 2.123
test.AddStatistic( "My Custom Stat", 2.12345, "Integer" ) ' Output is 2
test.AddStatistic( "The Best Market", "Gold", "String" )   ' Output is "Gold"
test.AddStatistic( "The Best Market", "Gold" )             ' Output is "Gold"
test.AddStatistic( "Return", 2.12345, "Percent" )         ' Output is "2.12%"
test.AddStatistic( "Return", 2.12345, 0, "Percent" )       ' Output is "2%"
test.AddStatistic( "Worst Date", 20010521, "Date" )       ' Output is "2001-05-21"
test.AddStatistic( "Highest Value", 500000, "Currency" )   ' Output is "$500,000"

 

Links:

 

See Also:

 

 


Edit Time: 9/25/2017 09:09:56 AM


Topic ID#: 128

 

 

Created with Help & Manual 7 and styled with Premium Pack Version 2.80 © by EC Software