How to use Soft Keys in QTP (Pls provide a code with example)I want to use soft keys like (Ctrl+F7),(Ctrl+F8) etc. in my script.
Thanks,
Vijay9421834186
NOTE : [I][This question was asked by vijay sawale][/I]
Printable View
How to use Soft Keys in QTP (Pls provide a code with example)I want to use soft keys like (Ctrl+F7),(Ctrl+F8) etc. in my script.
Thanks,
Vijay9421834186
NOTE : [I][This question was asked by vijay sawale][/I]
Window("[COLOR="DarkRed"]Microsoft Internet Explorer[/COLOR]").WinObject("[COLOR="darkred"]Internet Explorer_Server[/COLOR]").[COLOR="Blue"]Type [/COLOR]micCtrlDwn+micF7+micCtrlUp
etc...
the syntax is:
object.[COLOR="Blue"][B]Type [/B][/COLOR]keyboardInput
it is not advisable to use the soft keys in scripting.
If it is necessary the best way is to start record and use the soft keys then it will generate the code and you can use that for later use also.
Dont try to remember those statements to use them while you are enhancing the script.
here is the example
Window("Flight Reservation").ActiveX("MaskEdBox").Type micAltDwn + "f" + micAltUp
Window("Flight Reservation").ActiveX("MaskEdBox").Type micAltDwn + "o" + micAltUp
For pressing tab button on keyboard you can give....
Dim WshShell
set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{TAB}"
set WshShell=nothing
Similarly for other keys just type in the parameter.....within [B]"{}"[/B]
Eg - "{DOWN}"
Eg- "^"+"{F11}"