Finding several objects with specific values in a repository

Best practices, code snippets for common functionality, examples, and guidelines.
ukeggagu
Posts: 1
Joined: Wed Apr 19, 2017 12:27 pm

Finding several objects with specific values in a repository

Post by ukeggagu » Wed Apr 19, 2017 12:37 pm

I have used Ranorex Spy version 7.0.0 to generate a repository of thousands of objects i.e. WPF controls

What I want to do now is, try to find all objects which of type "Text" and which have a value of "focusable=false".

There are thousands of objects within the repository, so sifting through manually is not an option. Is there anything in Ranorex Spy which can help find these specific objects?

Thanks.

Gary

jma
Posts: 111
Joined: Fri Jul 03, 2015 9:18 am

Re: Finding several objects with specific values in a repository

Post by jma » Thu Apr 20, 2017 9:58 am

Hi Gary,

Basically, there's a search functionality in the Ranorex Repository, which you could use to search for a string value (for example, searching for a part of the path).
repository_search.png
repository_search.png (17.55 KiB) Viewed 455 times
Alternatively, I would suggest doing a live search for the elements in Ranorex Spy. After that, you can add the corresponding items to the repository.
spy_search.png
spy_search.png (21.99 KiB) Viewed 455 times
In my opinion the latter approach is better because you can do a more sophisticated search for UI elements. Furthermore, it makes sense to add only those UI elements to the repository, which are actually needed.

I hope that helps!