Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[QTP]Keyboard control + mouse click
#3
Solved: 10 Years, 9 Months, 1 Week ago
Hi, thanks for your reply. I found one solution work for me

Code:
Dim MyWebelement
Dim hwnd, DeviceReplay
Dim GetX, GetY

'I catch handler of IE where i will apply CTRL command
hwnd =Browser("D2_").GetROProperty("hwnd")
'I use library "Mercury.DeviceReplay" and Left Click of a mouse
Set DeviceReplay = CreateObject("Mercury.DeviceReplay")

'Command Ctrl Down on the IE
window("hwnd:=" & hwnd).type micCtrlDwn
'I get my Webelement
Set MyWebelement = Browser("browser").Page("page").WebElement("mywebelement")
'Found the position X and Y for my element i want to select
GetX = MyWebelement.GetROProperty("abs_x")
GetY = MyWebelement.GetROProperty("abs_y")
'Simulate de left click on this position (= mywebElement position)
DeviceReplay.MouseClick GetX,GetY, LEFT_MOUSE_BUTTON
wait 1
'Commnd Ctrl Up
window("hwnd:=" & hwnd).type micCtrlUp
'RAZ
Set DeviceReplay = Nothing

I hope this will help others persons ShyBig Grin
Lucie.

Someone now of to close this thread as "resolved" ? thanks Smile

Lucie.
Reply


Messages In This Thread
RE: [QTP]Keyboard control + mouse click - by lucieclaire - 12-18-2012, 03:11 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Getting background color of an object on mouse over Surya 2 3,724 06-27-2018, 08:51 PM
Last Post: vensas3181
  KeyBoard Events ravi.gajul 4 15,738 07-19-2017, 08:49 PM
Last Post: sathish_win@outlook.com
  How to get the links which appears on mouse hover of parent link rajendra649 9 34,861 03-10-2017, 06:35 PM
Last Post: satish00k
  how to use keyboard "Space' using qtp Naresh 2 2,944 06-11-2015, 06:30 PM
Last Post: venkatesh9032
  Automate BMC Control M applications using QTP Saranyaciet2 0 2,638 05-22-2015, 09:43 AM
Last Post: Saranyaciet2

Forum Jump:


Users browsing this thread: 1 Guest(s)