thexder1
12 years agoContributor
find object
I am working with software that has objects in the UI that have Items and sub Items, I am trying to find a way to check and see if an Item already exists, I need to be able to search through the entire hierarchy for it which could be 5 levels deep. I thought that the find object method would work for this, but when I put it in the test it asks for a property and a value and no matter what I enter in there it always says that it cannot find it. I have always worked with that with the correct window open and the Items already existing in the object.
Is there something that I am missing? Is there a better way to do this? So far the best that I have been able to come up with is to try selecting the item, calling the object method wSelected to get the currently selected item, then use an if then to check what is selected. The problem with this method of checking is that if the item does not exist then I get an error in the test eventhough it is not really a failure.
So far I am only working with keyword tests, but I am not opposed to changing the tests to a script, I just have not had to yet so I have not done it.
Is there something that I am missing? Is there a better way to do this? So far the best that I have been able to come up with is to try selecting the item, calling the object method wSelected to get the currently selected item, then use an if then to check what is selected. The problem with this method of checking is that if the item does not exist then I get an error in the test eventhough it is not really a failure.
So far I am only working with keyword tests, but I am not opposed to changing the tests to a script, I just have not had to yet so I have not done it.