Does an object have to be in Repository to use Info?
Posted: Thu Nov 03, 2011 10:33 pm
I'm doing web testing and I need to check if an object exists or not. Sometimes it does and other times it does not. I can use try / catch and then it just throws an exception when the path isn't found, but I read on your site that you can do something like this which I think is a better approach:
// Use the 'Info' object to check existence of the
// 'TextOnline' item which uses the following RxPath:
// statusbar/text[@accessiblename='Online']
// This way you can wait with the timeout specified for
// the item within the repository for the text 'Online'
bool statusTextConnected = repo.MyApp.TextOnlineInfo.Exists();
The thing is, I don't actually use the repository that Ranorex. I have my own repository class that contains getter methods for objects. The reason for this is that the Ranorex repository gets too disorganized.
So my question is.. can I still use the Info object on elements if they are not from the ranorex repository?
// Use the 'Info' object to check existence of the
// 'TextOnline' item which uses the following RxPath:
// statusbar/text[@accessiblename='Online']
// This way you can wait with the timeout specified for
// the item within the repository for the text 'Online'
bool statusTextConnected = repo.MyApp.TextOnlineInfo.Exists();
The thing is, I don't actually use the repository that Ranorex. I have my own repository class that contains getter methods for objects. The reason for this is that the Ranorex repository gets too disorganized.
So my question is.. can I still use the Info object on elements if they are not from the ranorex repository?