Posts: 20
Threads: 2
Joined: Apr 2008
Reputation:
0
08-17-2009, 04:19 PM
Hi,
Also logged case in HP but not got any satisfactory solution.
Can anyone please give solution to this issue.
Thanks,
Smita
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
08-17-2009, 04:32 PM
(This post was last modified: 08-17-2009, 04:36 PM by basanth27.)
Smita -
Try this,
Save the below file as dialoghandler.vbs file. Store it in your local hardrive.
Just before the code where the dialog comes up write this,
systemutil.Run "C:\windows\system32\wscript.exe", "C:\dialoghandler.vbs"
Let me know if this resolved your issue.
Code: Set fso = CreateObject("WScript.Shell")
While fso.AppActivate("Microsoft Internet Explorer") = FALSE
wscript.sleep 1000
Wend
fso.SendKeys "a", True
fso.SendKeys "~", True
wscript.sleep 7000
While fso.AppActivate ("WIP Session Recovery") = FALSE
wscript.sleep 1000
Wend
fso.SendKeys "~", True
Should be like this,
Code: SiebApplication("Siebel Sales").SiebScreen("Leads").SiebView("My Leads").SiebApplet("Lead").SiebPicklist("Lead Status").Select"Accept-Create New Project/Opty"
wait 2
systemutil.Run "C:\windows\system32\wscript.exe", "C:\dialoghandler.vbs"
'Line2:
'Browser("Siebel Sales").Dialog("Microsoft Internet Explorer").WinButton("OK").Click
I apologize.Pasted in haste, Corrections made to the function.
Code: Set fso = CreateObject("WScript.Shell")
While fso.AppActivate("Microsoft Internet Explorer") = FALSE
wscript.sleep 1000
Wend
fso.SendKeys "a", True
fso.SendKeys "~", True
wscript.sleep 7000
While fso.AppActivate ("Microsoft Internet Explorer") = FALSE
wscript.sleep 1000
Wend
fso.SendKeys "~", True
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.
Posts: 20
Threads: 2
Joined: Apr 2008
Reputation:
0
08-17-2009, 05:34 PM
Thanks for your solution,as today application is not working so cannot verify will surely let you know tomorrow.
Posts: 20
Threads: 2
Joined: Apr 2008
Reputation:
0
08-20-2009, 03:50 PM
Hi,
Getting issue as operation timed out.
Not able to add attachment here.
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
08-20-2009, 08:01 PM
Where does the timeout occur ? Can you please explain in detail ?
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.
Posts: 20
Threads: 2
Joined: Apr 2008
Reputation:
0
08-20-2009, 08:07 PM
When the message box appears qtp is stuck over there and does not do anything.
Then qtp throws message as Operation timed Out.
Posts: 1,003
Threads: 1
Joined: Jul 2009
Reputation:
5
08-20-2009, 08:23 PM
Thanks for the quick reply. I just want to reconfirm how you have used the code i provided ?
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.
Posts: 20
Threads: 2
Joined: Apr 2008
Reputation:
0
08-20-2009, 08:27 PM
I just copied the code and named it as dialoghandler.vbs in c drive.
Then exactly as you told in script i did the same
Posts: 1,199
Threads: 5
Joined: Nov 2008
Reputation:
0
08-21-2009, 10:12 AM
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
Posts: 20
Threads: 2
Joined: Apr 2008
Reputation:
0
08-21-2009, 10:56 AM
Hi,
Thanks for your solution.
Will try and let you know.
|