06-07-2012, 07:39 PM
[attachment=1008]Hi Anushree,
there are different ways we can handle this. But I think the best methodology is getting the hwnd of the popup window and then work on that.
Below is the simple code with sample windows application. I have attached the screenshot for better understanding.
Please let me know if you need any further help
there are different ways we can handle this. But I think the best methodology is getting the hwnd of the popup window and then work on that.
Below is the simple code with sample windows application. I have attached the screenshot for better understanding.
Code:
'Step1: Simulate your action to bring the popup window
'Click on the OK button in Login window which will simulate the popup window.
Dialog("Login").WinButton("OK").Click
'Step 2: Get the HWND of the popup window (assuming that the popup window is the top most window)
'Declare the extern
extern.Declare micLong,"GetForegroundWindow","user32.dll","GetForegroundWindow"
'Get the top most window hwnd
hwnd = extern.GetForegroundWindow()
'Step 3: Assign the HWND value to the Object in OR.
'set the hwnd value in object repository
Dialog("TopWindow").SetTOProperty "hwnd",hwnd
'Step 4: Continue working with popup window as usual
'Highlight the top most window
Dialog("TopWindow").highlight
'get the runtime property value (based on your requirement)
msgbox Dialog("TopWindow").GetVisibleText()
msgbox Dialog("TopWindow").GetROProperty("regexpwndtitle")
'perform operation on the top most window objects.
Dialog("TopWindow").WinButton("OK").Click
Thanks,
SUpputuri
SUpputuri