QTP and mouse scroll wheel recording

1,104 views
Skip to first unread message

ganesha

unread,
Jul 25, 2009, 9:28:42 AM7/25/09
to QTP - HP Quick Test Professional - Automated Software Testing
One of my colleagues has a requirement to automate "Press and hold
Ctrl key and the scroll wheel on the mouse to change the size of
model's appearance."

Manually I tried doing this in gmail opened in internet explorer.
After re-sizing the window to a smaller size I pressed Crtl key and
Mouse wheel to increase/decrease the text size.

Any inputs on a solution or alternate method to solve this would be
appreciated.


Roman Zilber

unread,
Jul 25, 2009, 4:10:15 PM7/25/09
to Mercu...@googlegroups.com

DeviceReplay


You would find more on HP knowledge base:


http://www.advancedqtp.com/knowledge-base/articles/qtp-tricks4/the-undocumented-devicereplay/

http://www.softwareinquisition.com/SIFL/_T__66A5B707-6838-4DCA-9F47-66C7D419E5B1_.Mercury.DeviceReplay.html




Set deviceReplay = CreateObject( "Mercury.DeviceReplay" )

SystemUtil.Run "notepad.exe", "", "", "open"

' ** this line always identifies the notepad window.

Window( "nativeclass:=Notepad", "index:=0″ ).Activate micLeftBtn

deviceReplay.SendString( "DeviceReplay" )

Set deviceReplay = Nothing

Ganesh muralidharan

unread,
Jul 28, 2009, 12:26:53 AM7/28/09
to Mercu...@googlegroups.com
Hi,
None of the links has mouse wheel recording method.
Regards,
Ganesh
--
Ganesh Muralidharan
Wipro Technologies
Mob. : 9341023574

'God Never Forgets'

Manish Bhalshankar

unread,
Jul 28, 2009, 12:48:29 AM7/28/09
to Mercu...@googlegroups.com
Hi Ganesh,
 
Another method of resizing is to press and hold the Ctrl key & use +/- for zoom in/out instead of the mouse scroller.

--
Regards,
Manish | HPCP

Messanger IDs:
Skype: manishbhalshankar
Yahoo: manishbhalshankar
GTalk: manishbhalshankar

Manish Bhalshankar

unread,
Jul 28, 2009, 1:09:42 AM7/28/09
to Mercu...@googlegroups.com
Hi Ganesh,
 
Try this:
 
SystemUtil.Run "C:\Program Files\Internet Explorer\iexplore.exe","","C:\Documents and Settings\Administrator","open"
Wait(3)
Browser("Browser").Navigate "http://www.google.com/"
Wait(5)
Set WshShell = CreateObject("WScript.Shell")
 
WshShell.SendKeys "^{+}"
Set WshShell = Nothing


Ganesh muralidharan

unread,
Jul 28, 2009, 9:41:24 AM7/28/09
to Mercu...@googlegroups.com
Thank you for the workaround but that doesnot seem to resolve the requirement here. They want to use the Ctrl and Mouse wheel for zoom in and zoom out of some snaps.

Roman Zilber

unread,
Jul 28, 2009, 2:06:26 PM7/28/09
to Mercu...@googlegroups.com
You can use AutoIt script (can be converted to exe)

Opt("WinWaitDelay",100)
Opt("WinTitleMatchMode",4)
Opt("WinDetectHiddenText",1)
Opt("MouseCoordMode",0)
WinWait("Google - Windows Internet Explorer","")
If Not WinActive("Google - Windows Internet Explorer","") Then WinActivate("Google - Windows Internet Explorer","")
WinWaitActive("Google - Windows Internet Explorer","")
MouseMove(139,247)
MouseDown("left")
MouseUp("left")
Send("{CTRLDOWN}")
MouseWheel("up", 10)
Send("{CTRLUP}")

Ganesh muralidharan

unread,
Jul 29, 2009, 8:31:21 AM7/29/09
to Mercu...@googlegroups.com
Thanks Roman
Is there a way of integrating AutoIT scripts with QTP?

Roman Zilber

unread,
Jul 29, 2009, 11:34:29 AM7/29/09
to Mercu...@googlegroups.com
There isn't, that way I wrote, you can convert the script to executable file.  So run it with SystemUtil.Run "File name"
You also can pass parameters to the script http://www.autoitscript.com/autoit3/docs/intro/running.htm#CommandLine


More info about the function
http://www.autoitscript.com/forum/index.php?showtopic=81761

rentala vdml

unread,
Jul 30, 2009, 8:00:16 AM7/30/09
to Mercu...@googlegroups.com
Hi Ganesha,
I can give you an alternate solaution to this.Try the below way .I think it would be helpful.If your problem is to resize the xisting window size we can do it by either pressing control button and scrolling the mouse.The other way is pressing the ctrl button.Hold it. and press the "+" key to increase and press " -" key to decrease it this can be done by Type Mic Up, Mic Dwn etc.
 
Window("Windows Internet Explorer").WinObject("Internet Explorer_Server").Type micCtrlDwn + "=" + micCtrlUp

Ganesh muralidharan

unread,
Jul 30, 2009, 10:31:40 AM7/30/09
to Mercu...@googlegroups.com
Hi,
 
The requirement here is not to inclrease the size of the window instead we want to magnify an image i.e. zoom in and zoom out in a window.

Sreedhar Mallipeddi

unread,
Aug 2, 2009, 10:39:40 PM8/2/09
to Mercu...@googlegroups.com
try the analog recording mode in QTP...
--
Mallipeddi Sreedhar
91-9000994721
Reply all
Reply to author
Forward
0 new messages