Highlighted
Super Contributor.
Super Contributor.
389 views

using micKeyCodes in a script

We're testing a web APP developed here, and at a particular place in the web APP, we need to hold the Shift key down and click on a WebElement object.

We tried Browser("B").Page("P").WebElement("Thingy").Click & micKeyShiftDwn
but that has syntax error.

How does a Tester use those marvelous micKeyCodes and vbScriptCodes?
Example script lines will be appreciated.

0 Likes
1 Reply
Highlighted
Respected Contributor.
Respected Contributor.

Re: using micKeyCodes in a script

Hi,

Hope that you are okay!

i used the following to simulate the hold down of the shift key ,

Dim test, subTest
Set subTest = Window("VMware Workstation")
set test =Window("VMware Workstation").WinEdit("Edit")
subTest.Type micShiftDwn
test.Click
test.Type "a"
wait 2
subTest.Type micShiftUp
test.Type "b"

In order to explain this once that you finish using the shift key,  use micShiftUp that method is going to release the shift key, otherwise it will keep holding the shift key,

other mic codes , in case that you need them

micCtrlDwn  Presses the Ctrl key. 
micCtrlUp  Releases the Ctrl key. 
micLCtrlDwn  Presses the left Ctrl key. 
micLCtrlUp  Releases the left Ctrl key. 
micRCtrlDwn  Presses the right Ctrl key. 
micRCtrlUp  Releases the right Ctrl key. 
micAltDwn  Presses the Alt key. 
micAltUp  Releases the Alt key. 
micLAltDwn  Presses the left Alt key. 
micLAltUp  Releases the left Alt key. 
micRAltDwn  Presses the right Alt key. 
micRAltUp  Releases the right Alt key. 
micShiftDwn  Presses the Shift key. 
micShiftUp  Releases the Shift key. 
micLShiftDwn  Presses the left Shift key. 
micLShiftUp  Releases the left Shift key. 
micRShiftDwn  Presses the right Shift key. 
micRShiftUp  Releases the right Shift key. 
micIns  Presses the Insert key. 
micDel  Presses the Delete key. 
micHome  Presses the Home key. 
micEnd  Presses the End key. 
micPgUp  Presses the Page Up key. 
micPgDwn  Presses the Page Down key. 
micUp  Presses the Up arrow key. 
micDwn  Presses the Down arrow key. 
micLeft  Presses the Left arrow key. 
micRight  Presses the Right arrow key. 
micEsc  Presses the Esc key. 
micBack  Presses the Backspace key. 
micReturn  Presses the Return key. 
micTab  Presses the Tab key. 
micBreak  Presses the Break key. 
micPause  Presses the Pause key. 
micPrintScr  Presses the Print Screen key. 
micWinLogoDwn  Presses the Windows Logo key. 
micWinLogoUp  Releases the Windows Logo key. 
micLWinLogoDwn  Presses the left Windows Logo key. 
micLWinLogoUp  Releases the left Windows Logo key. 
micRWinLogoDwn  Presses the right Windows Logo key. 
micRWinLogoUp  Releases the right Windows Logo key. 
micAppKey  Presses the Application key. 
micF1  Presses the F1 key. 
micF2  Presses the F2 key. 
micF3  Presses the F3 key. 
micF4  Presses the F4 key. 
micF5  Presses the F5 key. 
micF6  Presses the F6 key. 
micF7  Presses the F7 key. 
micF8  Presses the F8 key. 
micF9  Presses the F9 key. 
micF10  Presses the F10 key. 
micF11  Presses the F11 key. 
micF12  Presses the F12 key. 
micNumLockOn  Turns on the Num Lock. 
micCapsLockOn  Turns on the Caps Lock. 
micScrollOn  Turns on the Scroll Lock. 
micNumLockOff  Turns off the Num Lock. 
micCapsLockOff  Turns off the Caps Lock. 
micScrollOff  Turns off the Scroll Lock.

Just in case they use the same syntax

if you have any questions please let me know

Regards,

Francisco

0 Likes
The opinions expressed above are the personal opinions of the authors, not of Micro Focus. By using this site, you accept the Terms of Use and Rules of Participation. Certain versions of content ("Material") accessible here may contain branding from Hewlett-Packard Company (now HP Inc.) and Hewlett Packard Enterprise Company. As of September 1, 2017, the Material is now offered by Micro Focus, a separately owned and operated company. Any reference to the HP and Hewlett Packard Enterprise/HPE marks is historical in nature, and the HP and Hewlett Packard Enterprise/HPE marks are the property of their respective owners.