Change Font and Text Color for print statement in TestLog

Kenny K.
Milwaukee, WI

May 14, 2015
10 Posts

0  |  0  

Re: Change Font and Text Color for print statement in TestLog

Two Part Question:

The customer has asked that the test sequence abort if the Firmware version on the UUT does not match the expected Firmware version.  I can get the test program to do this, but the TestLog does not update with the value of the failed test, it aborts before the TestLog updates.  So I added a print statement to show the failure, but it blends in with the rest of the Test Log.

Here is part of the code from the test:  s_Temp is the variable from the vi that reads the Firmware Version

TestResult = s_Temp
!display test result before checking to abort.
i=6

if(TestResult = s_FWRevision)
    sTestStatus = sTestStatus + ":"
else
    sTestStatus = sTestStatus + "1:"
    print ,
    print "Firmware version expected: "
    print s_FWRevision
    print ".  Firmware actual: "
    print s_Temp
    abort !abort if the firmware version does not match.
endif

A)  Is it possible to have the "Firmware version expected: 2.11.  Firmware Actual: 2.2" to be larger and red, like the "....Application Aborted" text when ATEasy aborts.

B)  Is it possible to have the test results from the firmware test to post to the TestLog before the program runs the abort?  This would allow me to not use the extra print statement.  The TestLog would show "002    CheckFirmwareVersion    -   -   2.11    2.2    Fail" like a normal failed test.


File Attachment:
ateasy test.png

DrATEasy (Ron Y.)
Mission Viejo, CA

May 14, 2015
367 Posts

0  |  0  

Re: Change Font and Text Color for print statement in TestLog

A. Yes, use the HTML tag for font to change the font color and size, see http://www.w3schools.com/tags/tag_font.asp

In ATEasy you simply use the following:

print "<font size=\"3\" color=\"red\">This is some red text!</font>"

The test Exec driver has command to print in red (similar to the Abort message.

TestExec Log Append ( sText , [sHtmlPrefix] , [sHtmlPostfix] , [enLogView] - will print your test with the HTML tags around it. If the log is Plain text the tags will not print.

For example:

TestExec Log Append ( "Red Text", "<font size=\"3\" color=\"red\">", "</font>")

Also look at the following command :

TestExec Log Append Message

- will print messages similar to abort

B. If you called the abort by yourself, you can print the log string before the abort message, add the following to the test :

...
if failed
TestStatus=FAIL
print GetLogString(aLogStringCalcTestStatus)
abort
endif

BTW In ATEasy 9 152b the Application Aborted message change to Aborting... Since we not yet aborted.

More information about log print/append see the following KB article: http://www.marvintest.com/KnowledgeBase/KBArticle.aspx?ID=188



Please Note
You need to have a M@GIC account to participate in the Forums.
Not yet registered on our website? Click here to register today!

All content, information and opinions presented on the Marvin Test Solutions User Forums are those of the authors of the posts and messages and not Marvin Test Solutions'. All attachments and files are downloaded at your own risk. [Read More]