Forum Discussion

hmofaz's avatar
hmofaz
Occasional Contributor
9 years ago

Unable to Identify Devexpress control only during runtime

Hello,

We are automating an application which has devexpress controls in a report bar control.

 

When we open the report manually (Not by the Testcomplete during runtime), the controls appear and recognized by the Object Browser like it should be, but when we run the script via Testcomplete, the control does not recognized and does not appear in the Object Browser.

We eliminated ‘timing’ issue because we waited long time after the report opened by the script and after the Object Browser was refreshed and still the control was not recognized.

Why the tool can identify the control only manually and not by the script and how to solve this issue?

 

Thanks in advance

5 Replies

  • When you say the control is not recognised, do you mean you have it mapped, but it's not found during run time?

     

    At a guess, without seeing the map for the application, my first guess would be that a parent object is not being found. Possibly bad identification properties that change during runtime?

    • hmofaz's avatar
      hmofaz
      Occasional Contributor

      Yes, the control is mapped and has not been found during runtime only. The parent object is found and recognized

       

      In the attached image 'Manually.png' you can see the control "teGoToPage" when running manually

      The image 'Runtime.png' shows the same parent control but without this control along with a lot of other controls that 'disappeared' for some reason

       

  • It does sound like bad identification properties.

     

    Grab the old path to the control and then update the controls path and see if they differ. If so there's some property which is changing during runtime.

     

    If that is the case what object properties is the name mapping looking for?

    • hmofaz's avatar
      hmofaz
      Occasional Contributor

      As you can see on the images attached the control "teGoToPage" does not exist in runtime and exists when running manually, so how can we update the path?

      • Colin_McCrae's avatar
        Colin_McCrae
        Community Hero

        The parent objects are different.

         

        In your manual image you have: VCLObject("f_PrintPreview_QT")

         

        In your runtime image you have: VCLObject("f_PrintPreview")

         

        They are not the same parent object (one has "_QT" the end, the other doesn't.). So have different children. (The entire child object tree is different!)

         

        The parent of those controls - Window("MDIClient", "", 1) - also appears to be using an index number to identify itself. Thats never good. When it starts using index numbers, it does for a reason, in that it finds more than one but can't find any other way of telling them apart (automatic identification properties are by no means 100% perfect. Don't assume they will always work, all the time.). Avoid using them wherever possible.

         

        How it's ending up in this position, I don't know. As a guess, I would say either:

         

        1. Ambiguous object recognition of - Window("MDIClient", "", 1) -, causing it to end up with different child objects. As it's using an index, it's a definite possibilty.

         

        and/or

         

        2. You are doing something different at runtime so the objects produced are not quite the same as when you do it manually. Without seeing both processes, it's hard to say. It can be something as simple as the method you use to populate a field. If you are not setting a checkbox a certain way, or filling in a textbox - using Value() and SetText() methods is common ... I almost always use Keys() - wrong may not set off an event trigger in the code. Getting values into fields and checkboxes checked is half the battle. Getting them filled in and checked as close to how the user would do using the GUI - again - keys() vs SetText() - is the other half. Using native methods of objects to achieve things is often easy, but not how it happens when a user is operating the GUI.

         

        They're my suspicions, but it's kind of impossible to say without seeing how you got into this position in detail.