Press enter key in qtp

How to hit Enter in QTP. I select a cell and can set the value, now I want to press a key enterand get a list from this Java editing window. How can I achieve this?

+3
source share
3 answers
  • Using the Type Method mentioned above: YourObject.Type micReturn

  • Use the SendKeys method:

    SendKeys (sKey) Function

    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 waiting expectations

    Final function

In your case it will be

SendKeys "{ENTER}"

. MSDN SendKeys MSDN AppActivate .

+4

(micEnter) .Type() , FireEvent .

0

Set WshShell = CreateObject ("WScript.Shell")

WshShell.AppActivate

WshShell.SendKeys (ENTER) '-------- parentheses

0
source

Source: https://habr.com/ru/post/1761487/


All Articles