Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to write DP for a pop up window which appears only during execution and changes
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
[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.
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
Please let me know if you need any further help


Attached Files Image(s)
   
Thanks,
SUpputuri
Reply


Messages In This Thread
RE: How to write DP for a pop up window which appears only during execution and changes - by supputuri - 06-07-2012, 07:39 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Not getting error pop up when replaying through batch amit25007 0 1,396 02-14-2017, 04:01 PM
Last Post: amit25007
  Object doesn't support this property or method: 'window(...).window(...).winobject' senthil5683 1 3,688 07-04-2016, 07:08 PM
Last Post: venkatesh9032
  VB Script:number of times a character appears in a string with position Jyobtech 1 12,070 08-07-2013, 01:03 PM
Last Post: anil2u
  Handling pop-up message linhke 8 7,808 07-13-2010, 10:23 AM
Last Post: sasmitakumari
  POP versus OOP paradigm in DP jp@QTP 0 2,049 06-30-2008, 10:33 AM
Last Post: jp@QTP

Forum Jump:


Users browsing this thread: 1 Guest(s)