Forum Discussion

testing_dude's avatar
testing_dude
New Contributor
13 years ago

Extended Find Warning

In my testproject (web-based java application) i have implemented some functions to check objects. In this case its a function which offeres a simple visibility check of a gui element.



The pages of the application are created dynamically and objects appear or are hidden depending on the previous entries made to other objects in the application.

To test the visibility of an object I simply do a



> if(object.Exists)



If in the test specification the required state of an object is <not visible> and the object really does not exist, the testrun continues and a log is posted "check ok: item not visible", else an error would be logged and the testrun stops with an error.



My problem is:

If the item should not be visible and could naturally not be found by TestComplete, a warning is posted -> "The mapped item has the extended find attribute enabled"

The item is correctly not visible but the testrun finishes with a wrong state (with warnings instead of success).



Is it possible to disalbe this warning message?

I can not find anything in the preferences and when using a eventhandler it is only possible to add something to the currently fired event, but not to overwrite and handle the event by myself.

And it is also not possible to disalbe the extended find because in the application the parent objects are often created dynamically and the object tree can change from test to test, so i have to release the mapped objects from their mapped position to the mostly top level of the current page.



Thanks!

4 Replies

  • Hi,



    If you handle the OnLogWarning event, its handler receives the current warning which should be posted. You can disable it via OnLogWarning hadler's LogParams parameter. Check the LogParams.Str value and set LogParams.Locked to true if the warning message is the one you need to filter.
  • Aah, this easy... I've tried setting the params = null and was wondering why the log still gets posted... Thats why I thought I can only add sth to the event. :$



    This works fine, thank you!
    • swapnaliuk's avatar
      swapnaliuk
      Occasional Contributor

      Hi,

       

      I am having the same issue,

       

      Could you please explain me the solution in detail - I am trying to add an OnLogWarning event handler to my test.

       

      Thanks in advance.

      • Bobik's avatar
        Bobik
        Frequent Contributor

        Cause of the issue is incorrect "Exists" check for Mapped object, as I understand.
        When you try check like "Aliases.myProcess.myObject.Exists", TC first of all try search an object, posts errors and warnings to log and then checks for 'Exists'. Odd errors and warnings are posted when TC couldn't find an object.
        Correct way is use 'WaitAliasChild' or 'WaitNamedChild' methods:
        "Aliases.myProcess.WaitAliasChild('myObject', 5000).Exists".
        In this case when object not found you won't get error messages.