Forum Discussion

Luukdb's avatar
Luukdb
Contributor
3 years ago

Remove the "improve your test performance" in test log

Hello,

 

After the latest TestComplete update, the testlogs now show the message "Improve your test performance".

In those logs TestComplete tells us that we can move our xPath selectors to increase the performance. We are aware of this but do not want to do this.

Is there a way to deactivate these messages as we now only get warnings about performance?

 

 

Kind regards,

Luuk

  • Kitt's avatar
    Kitt
    Regular Contributor

    Can you share the exact version of TestComplete you are using (for the moderators)? In the event this is indeed a new feature you may want to post a new..new feature request to disable this in a future update [TestComplete Feature Requests]

     

    For now you can just click the checkbox next to 'Warning' in your log and it will disappear. For a more permanent solution you could create a OnLogWarning Event handler to turn the log off during this warning, something like:

    function EventControls_OnLogWarning(Sender, LogParams)
    {
      // Check if the message includes the desired substring
      var locked = aqString.Find(LogParams.Str, "Improve your test performance");
      if (locked != -1)
      {
        // If found, block the message
        LogParams.Locked = true;
      }
      else
      {
        // Else, post the message
        LogParams.Locked = false;
      }  
    }

    [TestComplete reference]

  • klabbe's avatar
    klabbe
    Occasional Contributor

    Just to let people know I have openned a case at SmartBear regarding this issue on July 29. The told be that this was an issue with the version 15.42 and they will let the dev team know about this problem. Hope it get fixed soon!

  • MarkHays's avatar
    MarkHays
    Occasional Contributor

    Tried adding the event handler as suggested by Kitt and it works.   Good to know that we can get around this issue that SmartBear has created.  TestComplete, should really have an option to turn off the checking of the performance and producing the error in the first place.   So, now there are checks for optimization, (that will make the current code slower for all XPath lookups).  We do not want those all the time.  It is good to have the capability, but allow us to turn them off/on as desired.

     

    IMO the event handler is a work around.

    • MarkHays's avatar
      MarkHays
      Occasional Contributor

      Kitt it appears that this ability to enable/disable steps is for keyword tests.  We are using Scripted tests.  Is there something similar for Scripted tests that you know of?

      • Kitt's avatar
        Kitt
        Regular Contributor

        Apologies, I was looking at the Keyword tag you referenced and assumed you were not scripting. You can still double click on the log message and it should jump to the line of code that is failing - where you can either remove it, comment it out and retry, or refactor it depending on what it's doing. If you are scripting, then I would think you have added your own Log.Warning() logic somewhere that is positing this message. Sharing a snippet of the code may help with more appropriate suggestions.