Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Query:Input from Keyboard
#1
Not Solved
Hello,

while recording my script in QTp9.2 with Java application,at one point I need to press Ctrl + F10 ,so that a Pop-up screen is displayed to completed the process in my application.How do i write a function in VB which could include this CTRL + F10 portion.

Please let me know.
Regards,
Rachna
Reply
#2
Not Solved
Hi...U can use SendKeys to handle keyboard events
Reply
#3
Not Solved
This example will be helpful to you for sending keyboard inputs to the application

Code:
set WshShell = WScript.CreateObject("WScript.Shell")
         WshShell.Run "calc"
         WScript.Sleep 100
         WshShell.AppActivate "Calculator"
         WScript.Sleep 100
         WshShell.SendKeys "1{+}"
         WScript.Sleep 500
         WshShell.SendKeys "2"
         WScript.Sleep 500
         WshShell.SendKeys "~"
         WScript.Sleep 500
         WshShell.SendKeys "*3"
         WScript.Sleep 500
         WshShell.SendKeys "~"
         WScript.Sleep 2500
Reply
#4
Not Solved
Hi..
Before writing this statement..
First Activate calculator..

--------------------
...calculator.activate
WshShell.SendKeys ("%{F4}")
------------------
Reply
#5
Not Solved
Yes, First the focus should be on Calculator and then use sendkeys to close it.
Reply
#6
Not Solved
Thanks for your help.
But while executing a scenario Tongueress CTRL F10 once the "Insertcard dailog" appears so that "keyEnter Dialog" appears and we can enter the Card number ihav eused the below mentioned script ,but it doesnt work.Kindly help.
Code:
JavaWindow("Sales_BasicFlow").JavaButton("Card").Click
JavaWindow("Sales_BasicFlow").JavaDialog("Credit/Debit Card Payment").JavaButton("£50.00").Click

set WshShell = CreateObject("WScript.Shell")
JavaWindow("Sales_BasicFlow").JavaDialog("Insert Card").Activate
wait(2)
WshShell.SendKeys("^{F10}")

JavaWindow("Sales_BasicFlow").JavaDialog("Key Enter").JavaEdit("Card Number").Set "5454609899026213"[hr]
Thanks for your help.
But while executing a scenario Tongueress CTRL F10 once the "Insertcard dailog" appears so that "keyEnter Dialog" appears and we can enter the Card number ihav eused the below mentioned script ,but it doesnt work.Kindly help.
Code:
JavaWindow("Sales_BasicFlow").JavaButton("Card").Click
JavaWindow("Sales_BasicFlow").JavaDialog("Credit/Debit Card Payment").JavaButton("£50.00").Click

set WshShell = CreateObject("WScript.Shell")
JavaWindow("Sales_BasicFlow").JavaDialog("Insert Card").Activate
wait(2)
WshShell.SendKeys("^{F10}")

JavaWindow("Sales_BasicFlow").JavaDialog("Key Enter").JavaEdit("Card Number").Set "5454609899026213"[hr]
Thanks for your help.
But while executing a scenario Tongueress CTRL F10 once the "Insertcard dailog" appears so that "keyEnter Dialog" appears and we can enter the Card number ihav eused the below mentioned script ,but it doesnt work.Kindly help.
Code:
JavaWindow("Sales_BasicFlow").JavaButton("Card").Click
JavaWindow("Sales_BasicFlow").JavaDialog("Credit/Debit Card Payment").JavaButton("£50.00").Click

set WshShell = CreateObject("WScript.Shell")
JavaWindow("Sales_BasicFlow").JavaDialog("Insert Card").Activate
wait(2)
WshShell.SendKeys("^{F10}")

JavaWindow("Sales_BasicFlow").JavaDialog("Key Enter").JavaEdit("Card Number").Set "5454609899026213"
Reply
#7
Not Solved
But while executing a scenario Tongueress CTRL F10 once the "Insertcard dailog" appears so that "keyEnter Dialog" appears and we can enter the Card number. i have used the below mentioned script ,but it doesnt work.Kindly help.
Code:
JavaWindow("Sales_BasicFlow").JavaButton("Card").Click
JavaWindow("Sales_BasicFlow").JavaDialog("Credit/Debit Card Payment").JavaButton("£50.00").Click

set WshShell = CreateObject("WScript.Shell")
JavaWindow("Sales_BasicFlow").JavaDialog("Insert Card").Activate
wait(2)
WshShell.SendKeys("^{F10}")

JavaWindow("Sales_BasicFlow").JavaDialog("Key Enter").JavaEdit("Card Number").Set "5454609899026213"[hr]
also tried dis:
Code:
Set WshShell = CreateObject("WScript.Shell")    WshShell.AppActivate "Sales_BasicFlow"    WshShell.Sleep 3000    WshShell.SendKeys "^{F10}"

i tried using this ,but still as in real scenario after press of Ctrl + F10 the next pop up appears of KEY entry...but after executing the script
in this statement:
WshShell.SendKeys "^{F10}"


no action is seen on the screen.

Please let me know how it can be resolved?
I am using QTP9.2 and working on Java Windows application
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Need to input Japanese Character through UFT Alaguraja 0 909 07-01-2020, 11:32 AM
Last Post: Alaguraja
  How to get input from the user in QTP? shanthiK 10 18,588 08-07-2017, 11:34 PM
Last Post: zunebuggy
  KeyBoard Events ravi.gajul 4 16,096 07-19-2017, 08:49 PM
Last Post: sathish_win@outlook.com
  how to use keyboard "Space' using qtp Naresh 2 3,117 06-11-2015, 06:30 PM
Last Post: venkatesh9032
  Query regarding "Call" statement anupam4j 1 2,048 09-26-2014, 01:46 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 2 Guest(s)