Micro Focus QTP (UFT) Forums
Need help for Enterkey functionality - Printable Version

+- Micro Focus QTP (UFT) Forums (https://www.learnqtp.com/forums)
+-- Forum: Micro Focus UFT (earlier known as QTP) (https://www.learnqtp.com/forums/Forum-Micro-Focus-UFT-earlier-known-as-QTP)
+--- Forum: UFT / QTP Beginners (https://www.learnqtp.com/forums/Forum-UFT-QTP-Beginners)
+--- Thread: Need help for Enterkey functionality (/Thread-Need-help-for-Enterkey-functionality)



Need help for Enterkey functionality - mahesh1612 - 11-22-2011

Hi All,

Can somebody send me the sample script for Enter key functionality.
I have tried with recording but it is not recognizing the enter key functionality. Any help is highly appreciated.

Thanks
Mahesh



RE: Need help for Enterkey functionality - vIns - 11-23-2011

Hi...u mean sendkeys method?

if yes,

Code:
Set WshShell = CreateObject("WScript.Shell")

WshShell.SendKeys("{ENTER}")



RE: Need help for Enterkey functionality - mahesh1612 - 11-23-2011

thanks for the response and I have tried with the above script but it is not acting as Enter.


RE: Need help for Enterkey functionality - krr - 11-23-2011

Use

WshShell.SendKeys "~"

That will work. Let me know if you have issues.


RE: Need help for Enterkey functionality - Acharya_silu@yahoo.com - 11-23-2011

ANS:
Hi,
u can use either of the methods
1)
Code:
Set WshShell=CreateObject("Wscript.Shell")
     WshShell.SendKeys("{ENTER}")

OR
2)
Code:
Set WshShell=CreateObject("Wscript.Shell")
   WshShell.SendKeys "~"

Thanks