Press Enter Key in qtp
Use mentioned above Type method:
YourObject.Type micReturn
-
Use SendKeys method:
Function SendKeys(sKey)
Set WshShell = CreateObject("WScript.Shell")
WshShell.AppActivate "Your browser" ' You may need to activate your browser first
WshShell.SendKeys sKey
wait(1) ' You may need to add some Wait statements around
End Function
In your case it will be
SendKeys "{ENTER}"
See MSDN SendKeys and MSDN AppActivate for more details.
![Sam](https://i.stack.imgur.com/7i1Bx.jpg?s=256&g=1)
Sam
Experience in building framework using testing tools like Cypress, selenium, webdriver, UFT/QTP. API testing framework using SOAP UI, POSTMAN, REST-Assured.
Updated on July 09, 2022Comments
-
Sam almost 2 years
How to perform the Pressing of Enter Action in QTP. I'm selecting a cell and able to set a value ,now I want to press enter key and get the list from that Java Edit box. Which are the different ways I can achieve this?