Forum Discussion

BD_Geoactive's avatar
BD_Geoactive
Contributor
29 days ago
Solved

Why my While Loop keyword test is breaking when the value found is = to False

When the value is found to be True, it does what i set it to do... but when the objects re closed, the value would return false.

Why the above wont work in Test Complete 15.81? 

When the while loop found the value to false it just said the object is not Visisble so it return false, but it stopped teh test because its flase. I though it should break out of the while loo and to the IC > MDIForm etc etc (next steps)

  • well thats the mysterious bit. obviously, i couldn't access the ChartForm when they all are closed. dont know how it does it, but using exists property does work when compared to using visible. or visibelOnScreen.

9 Replies

  • e.g., it stopped the test, instead of breaking out of the while loop, and continue the test?

     

    • rraghvani's avatar
      rraghvani
      Icon for Champion Level 3 rankChampion Level 3

      Does the object Aliases.IC.MDIForm1.MdiClient.ChartForm, actually exists?

      Check the project settings for "On error:"

       

      • BD_Geoactive's avatar
        BD_Geoactive
        Contributor

        Does the object Aliases.IC.MDIForm1.MdiClient.ChartForm, actually exists?

        Yes it does. There are multiple objects ('chartForm') that are opened, Using While Loop to close every single of them 1 by 1 until the object in question returns (VisibleOnScreen) false.

        I will check on the project settings.

  • Right I think i found 'why'.

    I am using the properties 'Visible' or 'VisibleOnScreen' - T.C will sees these object properties fine as they are exists in the Object browser. But once the object in question no longer there, then, the 'Visible' or VisibleOnScreen' becomes false negative.

    After looking around, the object in question becomes Non‑existent (Exists = False).

    So i used, 'Exist' property, instead. this works fine now. The While Loop does takes longer to respond when the 'Exist' = False though, but i can live with it.