Forum Discussion

wfetherolf's avatar
wfetherolf
Occasional Contributor
13 years ago

Suppress TestedApp Execution Log?

When you run a tested app from the TestedApps collection, a message is added to the log like this:



The application "C:\Program Files\FooTech\foobar.exe" started.



Is there any way to prevent or suppress this logging, besides executing the executable through the WShell object?  I'd like to keep the application in the TestedApps collection, as I've got NameMapping for the application and want to pull data from the application for use in other testing.



Thanks!

3 Replies

  • tristaanogre's avatar
    tristaanogre
    Esteemed Contributor
    There's no way that I know of to specifically suppress that with a config option.  However, you can use the OnLogMessage event handler to trap the message and "lock" it so it doesn't show in the log.
  • Hello Will,




    Here is how the code for the Robert's suggestion can look like:







    Sub GeneralEvents_OnLogMessage(Sender, LogParams)


      If aqString.Find(LogParams.Str, "The application")<> -1 And aqString.Find(LogParams.Str, "started") <> -1 Then


        LogParams.Locked = True


      End If


    End Sub







    For more information, refer to the Handling Events and aqString.Find help topics.
  • wfetherolf's avatar
    wfetherolf
    Occasional Contributor
    I ended up doing it in JScript, and I wanted to know if the application execution failed for some odd reason.  Here's what I did:





    function GeneralEvents_OnLogMessage(Sender, LogParams)

    {

     if (aqString.Find(LogParams.Str,"started")>=0)

     {

      LogParams.Locked=true;

     }

    }