0

I'm writing a script to automate a desktop application. The issue I'm having is that there are few windows that are not recognized by the QTP on run-time The script runs fine 70% of the time. But sometime it gives me an error saying that Object is not visible. And I have to manually delete the Object from OR and add it again to the OR. I don't know why it's doing it.
It would be very helpful to me.

Thank you.

ilaunchpad
  • 1,283
  • 3
  • 16
  • 32
  • Can you tell us what technique the desktop application follows? (WPF, java etc.) and are the _windows_ not recognized or only the _objects_ in some windows? Did you rule out that in these cases the same window/object is multiple times on the screen and that you need to adjust the ordinal quantifier (i.e. index or location)? – AutomatedChaos Jan 22 '13 at 20:01
  • @AutomatedChaos The application uses Activex. There are times when windows are not recognized and sometimes objects of the windows. Since this is actually my first work in QTP I didn't really pay attention to the use of the same windows in multiple places. Could you please inform me more about the ordinal quantifier. Thank You. – ilaunchpad Jan 22 '13 at 23:33
  • The ordinal identifier is the sequential occurence number when the window/object is present multiple times on your desktop/window. When no ordinal identifier is selected, QTP assumes the object is unique and will throw an error when the object is multiple times available. You can edit the ordinal identifier. On location: the position on the screen from top to bottom/left to right or on index: the position in the technical layout of your application. But you should use ordinal identifiers as a last resort, first try to solve it by making the description properties unique. – AutomatedChaos Jan 23 '13 at 06:45
  • @AutomatedChaos I do understand what you are trying to say here. But the main issue that I'm having is when I run a fresh start of the script it throws an error claiming the object is not recognizable when in the last run it was running fine the whole process. – ilaunchpad Jan 23 '13 at 14:52

1 Answers1

0

You should check the window's description and see how it differs from the existing window. Then you can update the description to either use a regular expression or use different properties.

Maintenance Run Mode can help you do this by showing the diff and suggesting regular expressions.

Motti
  • 110,860
  • 49
  • 189
  • 262