| || |
Problem with Java dialog remaining after closed
Using QTP 9.5 with Java Add-in loaded. I have run into an odd problem related to certain JavaDialog objects in my application. Java add-in recognizes a JavaDialog properly when first opened. I can add the object to my repository with no issues. If after adding the object to the repository I leave the object open and record and playback against the object, all is well. The object is recognized properly. The test object details for the object are as follows:
If I then close the dialog and reopen the dialog, the object is no longer recognized. If I add the dialog again to object repository the test object details are as follows:
toolkit class: class value
As I open and close the dialog repeatedly and add the object the repository repeatedly, the object details look like the above, but the index value increments by 1. If I select one of the added objects and click the highlight button, an area about the size of the dialog highlights at the upper left hand corner of the screen, but the dialog is not visible anywhere on screen.
Finally, having done all of the above, if I delete the main application window and then add the window back to the repository, taking in all object types, all of the previously added dialog objects appear in the repository, even though the dialog is not visible on screen.
I am guessing the app may be leaving some stuff associated with the dialog between each opening of the dialog and is thus confusing QTP, but if anybody has run into anything like this, I'd be interested in hearing about it.
Hopefully everything I have posted makes sense. Thanks for the help.
Re: Problem with Java dialog remaining after closed
Does make sense. Developers are not cleaning up (it appears anyway) as well as they should. No matter though, you should be able to change the Title (in the OR) to a wild card regular expression. Once you've done this, you won't need the ordinal identifier. For example, I have a dialog (or window or whatever) that has a title that always changes, depending on what I have loaded. Here's two examples of the title:
Open Slam Run
Open Orchid Run
Instead of having an object in the OR for each of those, for the title (in my OR) I use this:
Click the Regular Expression checkbox, and when it asks you if you want to escape, select 'No'. From there you should be all set.
Don't forget to remove (reset really) the ordinal identifier to None.
I suppose I should add that you could give your dialog something like Import.*. IF that doesn't work, try Impor.*