Ask a Question

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

SOLVED
prekar
Occasional Contributor

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.

prekar_0-1600999121214.png

It selects the whole box instead of just the dropdown

5 REPLIES 5
sonya_m
SmartBear Alumni (Retired)

Thank you for posting the question!

 

@Marsha_R  @Wamboo @anupamchampati @Reshail , any ideas on how this can be fixed?


Sonya Mihaljova
Community and Education Specialist

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?

 

Regards,
  /Alex [Community Champion]
____
[Community Champions] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Champions]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Champion] signature is assigned on quarterly basis and is used with permission by SmartBear Software.
https://community.smartbear.com/t5/Community-Champions/About-the-Community-Champions-Program/gpm-p/252662
================================
Reshail
Contributor

Hi Preker,

 

Alex has given you some good suggestions. Just for the sake of something different you can also look into the image based testing. You can add this dropdown arrow in your image repository and click on it through this approach. Here is a doc to help you out. 

https://support.smartbear.com/testcomplete/docs/testing-with/object-identification/image-based/about...

Marsha_R
Champion Level 3

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
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

 

cancel
Showing results for 
Search instead for 
Did you mean: