This should be really simple, but the correct syntax seems to be evading me.
What I need to do: Look for the titlebar of a dialog that is named "Message" and click on the titlebar. If the titlebar is not found within 1 minute, error out or fail in some way that I can handle it.
Right now, the dialog is not being displayed, so I need to have it go to the error handling, which will enter the failure into a log file.
I'm using Ranorex Studio 4.0.5.
Code I have tried:
Code: Select all
xpath = "/form[@title='Message']/titlebar[@accessiblerole='TitleBar']"
Ranorex.Validate.Exists(xpath, 60000)
Dim titlebar As New Ranorex.TitleBar(xpath)
titlebar.Click()
I've tried various ways of using FindSingle with a duration of 60000, but how can I do FindSingle on titlebar if I can't Dim titlebar? When I try to build the test with FindSingle, I keep getting build errors. TryFindSingle does not seem any better than FindSingle.
When the application that is being tested displays the Message dialog, the test code works fine, so it can identify the titlebar when it exists.
Any help is appreciated!