Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Issues while running QTP Script in Siebel.
#21
Solved: 10 Years, 8 Months, 3 Weeks ago
(08-21-2009, 10:12 AM)Saket Wrote: Hi Smita,

would you like to use Windows API in your script?
Try this - Paste the following code into your script or in a library file and call the function 'HandleDialog' where you want to handle the dialog

Code:
Extern.Declare micHwnd, "FindWindowEx", "user32.dll", "FindWindowExA", micHwnd, micHwnd, micString, micString
Extern.Declare micLong, "PostMessage", "user32.dll", "PostMessageA", micHwnd, micLong, micLong, micLong
Extern.Declare micLong, "GetWindow", "user32.dll", "GetWindow", micLong, micLong

Const BM_CLICK = &HF5
Const WM_SETFOCUS = &H7



Public Function HandleDialog()

    pHwnd = extern.FindWindowEx(0,0, vbNullString, "Microsoft Internet Explorer")
    'pHwnd = extern.FindWindowEx(0,0, vbNullString, "Message from webpage")
    extern.PostMessage pHwnd,WM_SETFOCUS,0,0
    If pHwnd > 0 Then
        btnHwnd = extern.FindWindowEx(pHwnd,0,"button" ,vbNullString)

        extern.PostMessage btnHwnd,WM_SETFOCUS,0,0
        wait(5)
        extern.PostMessage btnHwnd,BM_CLICK,0,0
    End If

End Function

Let me know if there is any issue

Saket -
This is a nice piece of code. I was just wondering would it not treat IE as a window since "Microsoft Internet Explorer" is the tag we are providing to search for ?

Smita -
did any of the other solutions help you so far ?
Basanth
Give a fish to a man and you feed him for a day..Teach a man how to fish and you feed him for life.
Reply


Messages In This Thread
RE: Issues while running QTP Script in Siebel. - by basanth27 - 08-21-2009, 10:57 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Issues while uft script execution AAB 4 4,488 10-05-2015, 07:23 PM
Last Post: supputuri
  Running QTP scripts without QC sowjanya 3 5,912 07-16-2015, 11:16 AM
Last Post: ravi.gajul
  QTP Siebel: execution issue when form applet button invokes browser dialog box impreetam 2 4,452 02-06-2014, 12:23 AM
Last Post: vsampark
  Windows 8 envirnment error while running QTP script. Rashmi Rajpal 0 2,335 10-10-2013, 12:21 PM
Last Post: Rashmi Rajpal
  QTP does not stop running furqanmlk 2 3,665 08-25-2013, 02:06 PM
Last Post: GregHicks

Forum Jump:


Users browsing this thread: 1 Guest(s)