Can not get UFT to press a funtion key

  • Questions
  • Can not get UFT to press a funtion key
Question ID: 107018
2
0

I am having a problem trying to press the function key F12 in our AUT. Here’s the code that I.m trying to use for pressing F12.

Set WshShell = CreateObject("WScript.Shell")
WshShell.SendKeys "{F12}"

Marked as spam
Posted by (Questions: 338, Answers: 20)
Asked on July 29, 2016 9:12 pm
5 views
Answers (1)
2
Private answer

Try using DeviceReplay instead:

Set DeviceReplay = CreateObject(''Mercury.DeviceReplay'')
Window(''Notepad'').Activate 'Activate YOUR AUT instead of Notepad.
DeviceReplay.PressKey 88
Set DeviceReplay = Nothing

You can find more information about this at these links:

https://softwaresupport.hpe.com/group/softwaresupport/search-result/-/facetsearch/document/KM178207
https://softwaresupport.hpe.com/group/softwaresupport/search-result/-/facetsearch/document/KM184330
https://softwaresupport.hpe.com/group/softwaresupport/search-result/-/facetsearch/document/KM1194127

Marked as spam
Posted by (Questions: 16, Answers: 748)
Answered on July 29, 2016 9:12 pm
That worked perfectly. Thanks!
( at July 29, 2016 9:14 pm)