Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
KeyBoard Events
#1
Solved: 10 Years, 7 Months, 4 Weeks ago
Below code is used to right click on a webpage and perform a click on a particular item displayed on the box
Code:
Setting.WebPackage("ReplayType") = 2 ' This lines changes the run mode as Analog
Browser("name:=Google").Page("title:=Google").WebEdit("name:=q").FireEvent "onclick",6,126,micRightBtn
wait(2)
Set WshShell = CreateObject("WScript.Shell")
itemIndex=16      ' Option number

For i = 1 To itemIndex
WshShell.sendkeys "{DOWN}" 'Navigate to the option
Next
WshShell.sendkeys "{ENTER}"
Set WshSEll = nothing
msgbox Browser("name:=Google").Dialog("regexpwndtitle:=Properties").Page("title:=General").WebEdit("html id:=_URL").getRoProperty("innertext")

However, I would like know how to generate the press and hold control button event? Your help is much appreciated.

Thanks,
Ravi
Reply
#2
Solved: 10 Years, 7 Months, 4 Weeks ago
Hi Ravi,
Below lines may help you.

Code:
oShell.SendKeys "{ESC}"    - press escape key
oShell.SendKeys "john"    - type john
oShell.SendKeys "+^{ESC}"    - press Ctrl + Shift + Esc keys (open Windows Task Manager)
oShell.SendKeys "%{F}"    - press Alt + F key (open file menu)
Above source taken from
http://www.qtpschool.com/2011/03/sendkey...ns-in.html

Thanks,
Suresh.
Reply
#3
Solved: 10 Years, 7 Months, 4 Weeks ago
I figured that out Suresh.Thank you though.....Smile
Reply
#4
Solved: 10 Years, 7 Months, 4 Weeks ago
(12-28-2011, 11:48 PM)ravi.gajul Wrote: I figured that out Suresh.Thank you though.....Smile

Could you please send the code for handling right click / context menu
Reply
#5
Solved: 10 Years, 7 Months, 4 Weeks ago
(12-28-2011, 11:48 PM)ravi.gajul Wrote: I figured that out Suresh.Thank you though.....Smile

Used the following code to right click - obj.MouseClick absx+5, absy+52 ...
but the options are not coming as context menu, it is tree view and each options are individual objects..
any idea on how to select the value after right click...
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  how to use keyboard "Space' using qtp Naresh 2 2,913 06-11-2015, 06:30 PM
Last Post: venkatesh9032
  Problem Firing events on Flex components endpoint 0 2,181 09-10-2014, 06:52 PM
Last Post: endpoint
  Problem in Input from keyboard:sendkeys Rachna 1 4,756 10-14-2013, 06:07 PM
Last Post: anil2u
  Keyboard Shortcuts "Ctrl+s" are not working in QTP11 dipti 0 2,925 12-31-2012, 05:08 PM
Last Post: dipti
  [QTP]Keyboard control + mouse click lucieclaire 2 22,357 12-18-2012, 03:11 PM
Last Post: lucieclaire

Forum Jump:


Users browsing this thread: 1 Guest(s)