Forum Discussion

SlickRick's avatar
SlickRick
Frequent Contributor
12 months ago

Mislocated control location detection

Hi all,

so i have a keyword test that will select from a combobox an item using the WPF.AutomatedID.

Locally it is working fine, however on my build server it seem like the location detected for this control is off.

So first i perform a click on the combobox to show the control, then perform a click on the desired item inside of that combobox using the WPF.AutomatedID control detection.

I used this instead of using the Combobox.ClickItem(index) before i find it more flexible if the order of the items inside the combo box changes.

Here is the keyword steps:

So here is what a playback look on my machine:

And here is what it looks like on the build server:

 

Not too sure why it would behave this way?

 

Any ideas?

I have the latest version of both test complete and test execute

  • rraghvani's avatar
    rraghvani
    Champion Level 3

    Are you not able to use e.g. ClickItem("Fall Of Potential") to select the item?

    • SlickRick's avatar
      SlickRick
      Frequent Contributor

      I always try to code my test using the AutomationID, this way i can perform my test in various languages.

      And in this test  im actually trying to select the "Return" item, but somehow the control seems to be wrongly located but only on the build server. Seems to be related to some resolution issue but it seems to occur only with that particular listbox.

      • rraghvani's avatar
        rraghvani
        Champion Level 3

        I've seen situation like this on a web application, where the footer or scroll bar may appear, which pushes the page up slightly. During that point in time, TC will attempt to click the item using X and Y coordinates, but fails. Due to the web page shifting up slightly!

        I think the underlying code within TC, gets the rectangle coordinates of the UI Object, and clicks the centre.