How to get output of WARNING from Exec Log to html report

Tips and Tricks relating to Usability
Post Reply
mpohlen
User
User
Posts: 2
Joined: Thu Apr 23, 2015 11:53 pm
First Name: Michael
Last Name: Pohlen
Company: Gemini Observatory

How to get output of WARNING from Exec Log to html report

Post by mpohlen » Fri Apr 24, 2015 7:26 pm

Hi,
we are using the 'Warning' command to create an html report of each run telling us where there were issues during the execution, e.g.

Code: Select all

 
WaitFor match template="template.png" method=search2 timeout=5s
 if ({_EXIT_CODE} > 0) {
    Warning "Image could not be matched"
  } else { .... } 
Each time the WaitFor runs into an error we also get a WARNING (orange colour) in the Exec Log. This warning contains some 2-3 lines of useful information such as in which tpr script at what line which kind of error occurred.

Is there any way to get the output of the warning in the Exec Log as an input to our 'Warning' commands so we see the same useful information in the html report?

Many thanks,

-Michael

rpes
User
User
Posts: 74
Joined: Thu Oct 29, 2009 5:43 pm
First Name: Robert
Last Name: Pes
Company: T-Plan

Re: How to get output of WARNING from Exec Log to html report

Post by rpes » Tue Apr 28, 2015 5:31 pm

I'm afraid it's not possible with the current release. These two pieces of information come from two well separated features, the Waitfor and Warning commands. It should be possible through the Java API but since you are using the TPR language it doesn't apply to you.

We could deliver such a functionality in a future release. The easiest and most general option would be to introduce a new dynamic variable, let's say "_STACK" which would expand into a text of the current stack. To get it into the report you would just call that variable in the Warning message body:

Code: Select all

Warning "Failed to find component XXX: {_STACK}"
I'll put it onto the feature wish list.

Post Reply

Who is online

Users browsing this forum: No registered users and 1 guest