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.



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





String that names the added statistic


Value of that statistic

[decimal places]

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


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


Type Options:



Prints as an integer, truncated.


Prints as a floating point number, default.


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


Prints as a comma delimited number with currency symbol prefixed.


Prints as a date string YYYY-MM-DD.


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



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"




See Also:



Edit Time: 5/31/2017 10:33:26 AM

Topic ID#: 128



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