Press Enter Key in qtp

41,674
  1. Use mentioned above Type method: YourObject.Type micReturn

  2. 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.

Share:
41,674
Sam
Author by

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, 2022

Comments

  • Sam
    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?