cancel
Showing results for 
Search instead for 
Did you mean: 

desktop dropdown example getting number

SOLVED
Highlighted
Contributor

desktop dropdown example getting number

A simple example on how to get the numbers of items in a dropdown and their name:, the only thin I manage is to click its index:

function cardpocket(var item=0) {
  sp = Aliases.LraClient.CardInfoView.StackPanem.SelectPocket;
  if sp.Exists) {
    sp.ClickItem(item);
  }
}

sp.Items return an object, but its length=0. there is no PropertyItem, I assume I need to do some Child() navigation but haven't found any examples on this.

 

 

 

1 ACCEPTED SOLUTION

Accepted Solutions
Highlighted
Community Hero

Re: desktop dropdown example getting number

Hi,

 

I think that you need to talk to developers and ask them about this control.

It might be that control is composed from two (independent) parts: arrow and the list that is displayed after the arrow is clicked. (You may check this with the help of the Object Spy in the point-and-fix mode: open the drop-down and check if the list is recognized as a separate control. If this is the case than you will have to click on the arrow, wait until the list is displayed and populated with values and then work with the list itself.)

Control might appear to be composite one. In this case https://support.smartbear.com/testcomplete/docs/app-testing/desktop/wpf/template-support.html might help.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] 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 Heroes]
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 Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

5 REPLIES 5
Highlighted
Community Hero

Re: desktop dropdown example getting number

It would be helpful to know more about the drop down control itself.  Can you post screenshots of the Object Spy indicating properties, etc., of the drop down object?


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
Highlighted
Contributor

Re: desktop dropdown example getting number

Enclosed pictures, there is no name on the dropdown, just a down arrow, but I'm unable to get the '2' or the '3' or the number of items:

dropdown.pngobjectfinder.pngobjectfinder2.png

Highlighted
Community Manager

Re: desktop dropdown example getting number

Notice anything weird with this control? 🔍

@AlexKaras @Wamboo @Reshail 


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
Highlighted
Community Hero

Re: desktop dropdown example getting number

Hi,

 

I think that you need to talk to developers and ask them about this control.

It might be that control is composed from two (independent) parts: arrow and the list that is displayed after the arrow is clicked. (You may check this with the help of the Object Spy in the point-and-fix mode: open the drop-down and check if the list is recognized as a separate control. If this is the case than you will have to click on the arrow, wait until the list is displayed and populated with values and then work with the list itself.)

Control might appear to be composite one. In this case https://support.smartbear.com/testcomplete/docs/app-testing/desktop/wpf/template-support.html might help.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] 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 Heroes]
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 Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================

View solution in original post

Highlighted
Community Manager

Re: desktop dropdown example getting number

Thank you for the great suggestion Alex, as always🙂

 

@mortenb123 Does this advice help? 


Sonya Mihaljova
Community and Education Specialist

Did my reply answer your question? Give Kudos or Accept it as a Solution to help others. ⬇️⬇️⬇️
New Here?
Join us and watch the welcome video:
Announcements
Top Kudoed Authors