Forum Discussion

prekar's avatar
prekar
Occasional Contributor
5 years ago

Object Spy doesn't focus on dropdown arrow of the desktop application

Hi Everyone,

I try to spy on drop down arrow of a desktop application built using power builder 12.5 but it doesn't find it. 

I have tried ClickItem(), wIsdropdownopened function etc but nothing works.

In my application only if i click the arrow the dropdown list expands.

As of now i enter the text as a work around but i really want to traverse through the drop down list.

I'm new to Desktop application testing so an help is apprecioated.

It selects the whole box instead of just the dropdown

  • AlexKaras's avatar
    AlexKaras
    Champion Level 3

    Hi,

     

    Most probably, the arrow is a part of the control and is not exposed, thus Object Spy cannot identify it.

    Two usual workarounds (in addition to the third one that you already implemented;) ) :

    a) Focus the control and send it Alt-Down keys combination. Usually this opens the drop-down. E.g.:

    control.Focus();

    control.Keys("~[Down]");

    b) Do a click 2-3 pixels left from the right border of control - this is where the drop-down arrow is rendered. E.g.:

    control.Click(control.Left + control.Width - 3, control.Top + control.Height / 2).

     

    Does this help?

     

    • Marsha_R's avatar
      Marsha_R
      Moderator

      You may also be able to traverse the values in the drop down with out actually opening it.  Look in the Advanced view of Object Spy for a value that has an index and that could give you the drop down values directly.

    • prekar's avatar
      prekar
      Occasional Contributor

      Thanks AlexKaras 

      The first option didn't as it told the textbox not visible but the second option worked.

      Thanks Reshail.. The Image based testing was much easier to do as my application contains too many drop down arrows and this helped me to capture all the dropdowns in one screen easily

      Thanks Marsha_R I did try that but only one element (First one) from the list is enabled and others are disabled /hidden