Forum Discussion

RUDOLF_BOTHMA's avatar
RUDOLF_BOTHMA
Community Hero
6 years ago

aqObject.GetPropertyValue object does not exist after an exist check passes

Hi all,   New one that suddenly started and intermittently pops up.   Code:   var loadingPanelObj = Aliases.browser.FindChildEx(["ObjectType","ObjectIdentifier"],["Table","ASPxLoadingPane...
  • AlexKaras's avatar
    6 years ago

    Hi,

     

    > In theory if the .Exists is true, the next step shouldn't say it doesn't exist ?

    Correct. But only in case if the object was not recreated (or just destroyed).

    Note, that you are using Aliases to reference test objects and this is fine. But Aliases functionality has some specific that it caches objects once found and tries to reuse them later. And if the object is recreated, the problem will occur. See https://support.smartbear.com/testcomplete/docs/reference/test-objects/members/common-for-all/refreshmappinginfo-method.html for some more description.

     

    My guess is like yours: the target table might be recreated by script code on the page and this invalidates its previously found (and cached) instance. If this is the case, then you need to figure out the way (or ask developers to implement some flag for you) to identify if test code must wait for the table to be recreated.

     

    P.S.

    Out of curiosity: why instead of

    var isVisible = aqObject.GetPropertyValue(loadingPanelObj,"VisibleOnScreen");

    not to use just

    var isVisible = loadingPanelObj.VisibleOnScreen;

    ?