Hi,
In my example, I've used the title bar to identify the popup window. But of course, you can use anything you like from the popup window to identify the popup window. Simply track the window element inside the popup window and add it to the repository. Then instead of using the title bar repo item, use the repo item from inside of the popup window.
If you want to check the combination of the title and dynamic text from inside of the popup window you can use something like this:
Code: Select all
If myRepoElement Is repo.Notepad_About.SelfInfo andalso repo.Notepad_About.DynamicText.Caption.Contains("service pack 1") Then
Where
repo.Notepad_About.DynamicText is the repo element containing the dynamic text inside the popup window. I'm not sure you can use the reg. exp. operator ~ in If..Then statement, like in your example?
There may be better ways to achieve what you want, maybe even without using the repository element (e.g. using xpaths), but I'm not that skilled in Ranorex & .net programming yet
Below is attached the updated sample project. Just one additional note about it. The DynamicText repo element in this example uses instance number to identify itself. But instance numbers are not a very good to identify the GUI elements, because they often change! Unfortunately, because the
Text and
AccessibleName attributes contains the same string, which is not unique enough (and which will definitely change on different systems), instance number is probably the only way to identify this element. Just ask your developers to use meaningful and unique AccessibleName attributes for each GUI element in your app. Hope this helps a bit?
