Forum Discussion

tvklovesu's avatar
tvklovesu
Frequent Contributor
2 years ago

Warning messages in the test run log for improve performance

Hello,

Recently I have updated all my nameMapping to use unique identifiers in the XPath and deleted all others that TC saved when recorded. So tipically I have only one selector for each object or element. When I ran the test it gave me the following warning almost for all the objects. 

 

You can improve the performance of the object search in the test.

The NameMapping.​Sys.​browser.​pageAuth.​login_SignIn_Btn object

can be found faster if you make //input[@type="submit"] the first selector in its selector list.

 

And in the nameMapping for this object I see only one selector as I mentioned above. Still not sure why its throwing warning messages. Even when I click on Improve performance button in the log it just added an Empty selector, and even with that when I rerun the test it gave same message. One another thing is that the Extended Find column doesn't have any checkboxes.

 

Is there something I missed in the settings or somewhere else

 

TIA

3 Replies

  • Kitt's avatar
    Kitt
    Regular Contributor

    Unfortunately, for now you have to add an OnWarning Event Control. Here's there script I use:

    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;
      }  
    }

     This is a known issue and I've seen a few recent posts regarding this topic, so hopefully it get's updated soon. 

    [here] and [here]

    • tvklovesu's avatar
      tvklovesu
      Frequent Contributor

      Thanks for the code. This hides the warning messages, but as you mentioned this is not a permanent fix. I will wait for the fix. I can also uncheck the warning box in the test log report.

       

      Thanks

  • scottroutesmart's avatar
    scottroutesmart
    Occasional Contributor

    I logged a support case for this issue today finally because it junks up my logs, and also linked it to this thread.  I created a new test repo pointing to theonion website to demonstrate this issue occurring, and provided that repo to them so they can reproduce the issue.  Hopefully we can finally get this resolved.