12-29-2011, 05:22 PM
My application is java swing and uses JidePopups containing java menus which QTP recognises as JavaMenu objects.
In order to close a tab in the application I right click on it and have to select the "Close" JavaMenu item from the popup. My code is as follows:
However, it seems that following the execution of the right click command, focus is lost from the popup when QTP goes to the next code line, and because focus is lost the popup disappears. When QTP comes to execute the selection of the Close menu item, it is no longer there and the action doesn't take place.
Has anyone come across this before with java popups or more specifically, JidePopups?
Strangely, when I record these actions and play them back it works fine, but I can't use the recorded versions due to the way my scripts have to be set up.
In order to close a tab in the application I right click on it and have to select the "Close" JavaMenu item from the popup. My code is as follows:
Code:
JavaWindow("ldnGUI").JavaTab("TdiGroup").Click 10,10,"RIGHT"
JavaWindow("ldnGUI").JavaMenu("label:=Close").Select
However, it seems that following the execution of the right click command, focus is lost from the popup when QTP goes to the next code line, and because focus is lost the popup disappears. When QTP comes to execute the selection of the Close menu item, it is no longer there and the action doesn't take place.
Has anyone come across this before with java popups or more specifically, JidePopups?
Strangely, when I record these actions and play them back it works fine, but I can't use the recorded versions due to the way my scripts have to be set up.