PostKeys Action (Edit Controls)

Applies to TestComplete 14.72, last modified on January 20, 2021


The PostKeys action enters text in Internet Explorer's address bar. It is an analogue of the Keys action applied to the address bar control.

We do not recommend automating the browser's address bar. Instead, open web pages by using the Browsers.Item(...).Run and Navigate methods.



TestObj A variable, parameter or expression that specifies a reference to one of the objects listed in the Applies To section
Keys [in]    Required    String    

Applies To

A Win32 Edit object corresponding to Internet Explorer's address bar.

View Mode

To view this method in the Object Browser panel and in other panels and dialogs, activate the Advanced view mode.


The method has the following parameter:


Specifies the keystroke to be simulated.

To simulate the pressing of system keys, such as Ctrl, Alt, Shift, F1, Tab and others, use the following constants:

Constant Simulated Key
^ Ctrl
! Shift
~ Alt
^^ ^
!! !
~~ ~
[[ [
[Apps] Application key
[BS] Backspace
[Caps] Caps Lock
[Clear] Clear
[Del] Delete
[Down] Down
[End] End
[Enter] Enter
[Esc] Esc
[F1] F1
[F2] F2
[F3] F3
[F4] F4
[F5] F5
[F6] F6
[F7] F7
[F8] F8
[F9] F9
[F10] F10
[F11] F11
[F12] F12
Constant Simulated Key
[Home] Home
[Ins] Insert
[Left] Left
[NumAsterisk] Num * (* on the numeric keyboard)
[NumLock] Num Lock
[NumMinus] Num - (- on the numeric keyboard)
[NumPlus] Num + (+ on the numeric keyboard)
[NumSlash] Num / (/ on the numeric keyboard)
[PageDown] PageDown
[PageUp] PageUp
[Pause] Pause
[PrtSc] PrintScreen
[Right] Right
[ScrollLock] Scroll Lock
[Tab] Tab
[Up] Up
[Win] Windows key
[Pnnn] Pauses typing for nnn milliseconds.
[Xnn] Specifies a key by its virtual-key code. nn is the decimal virtual-key code of the desired key. For example, [X107] corresponds to the Num Plus key. To learn more about virtual-key codes, see the Virtual-Key Codes article in the MSDN Library.

If the Win32API plugin is installed and enabled in TestComplete, you can refer to the virtual-key codes using the corresponding VK_xxxx constants without the need to define them in your tests. For example, you can use the VK_ADD constant to specify the Num Plus key. The available VK_xxxx constants are listed under the Win32API node in the Code Completion window.

[Dnn] Presses a dead key specified by its key code nn.
[Altnn…] Simulates pressing Alt and typing numeric keys on the numeric keypad (that is, Alt+the character code). nn… is a sequence of numeric keys to be pressed, for instance, [Alt119] will simulate pressing Alt and typing the 1, 1 and 9 keys on the numeric keypad.
All constants (F1, PageDown, X, P, etc.) are case-sensitive.

See Also

Keys Action
Simulating Keystrokes in Browsers

Highlight search results