Was this page helpful?

SendKey() issues

     

    Problem 1: Windows key doesn't launch Windows Start Menu

    Review details problem

    Normally with the following code, you may launch Windows Start Menu by Newtest.

    reference to undefined name 'syntax' Une exception de type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' a été levée. (click for details)

    Or

    reference to undefined name 'syntax' Une exception de type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' a été levée. (click for details)

    Or

    reference to undefined name 'syntax' Une exception de type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' a été levée. (click for details)

    However, in Windows OS later than 8.1, these codes may have no effect and this could be aleatory.

    Solution(s)

    You may find through Microsoft Online Doc more detailed information and solutions on Windows Start Menu error issue.

    We highly suggest you to, if possible, replace launching applications from Windows Start Menu by AppExec() or ProgramExec() functions which could execute directly third-party programs.

     

    Problem 2: Special keys like CTRL/SHIFT/ALT/WIN lost through RDP

    Review details problem

    When connecting through Remote Desktop Protocol(RDP) tool to another Windows session, SendKey() and SendKeyCombination() with special key combinations may lose these special keys.

    For example :

    reference to undefined name 'syntax' Une exception de type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' a été levée. (click for details)

    The above code through an RDP connection may only send UP key to the remote session.

    Solution(s)

    1. RDP connection options could help reduce key-losing probability.

    You may find through Microsoft Online Doc more detailed explanation on different options.

    2. To workaround with On-screen keyboard

    You may find through a Microsoft Forum discussion on this issue. It shows that this problem might be related to your local Windows OS build version and the remote Windows OS build version. An efficient workaround would be using the On-screen Keyboard.

     

    Within Newtest environment, you may use SearchBitmap() or SearchOcr() function to interact with On-screen Keyboard.

     

    Problem 3: Sendkeys lost through RDP login process

    Review details problem

    When connecting through Remote Desktop Protocol(RDP) tool to another Windows session, SendKey() and SendKeyCombination() may lose or change the disered sended keys through RDP.

    Solution(s)

    1. RDP connection options could help reduce key-losing probability.

    You may find through Microsoft Online Doc more detailed explanation on different options.

    2. To workaround with On-screen keyboard

    You may find through a Microsoft Forum discussion on this issue. It shows that this problem might be related to your local Windows OS build version and the remote Windows OS build version. An efficient workaround would be using the On-screen Keyboard.

    3. Use the RDP tool provided with the robot to connect to the VM

    Within Newtest environment, you may use the RDP tool found in "C:\Program Files (x86)\IP-LABEL\NEWTEST\Robot\EXE\RDP" to connect to a virtual machine.

    For example :

    reference to undefined name 'syntax' Une exception de type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' a été levée. (click for details)
    4. To workaround by using the clipboard function

    Within Newtest environment, you may use Toclipboard() function to put the desired text on to the windows clipboard and then paste it later using the shortcut CTRL + V with Sendkey("~V") or using Sendkeycombination("'{CTRL}(v)").

    5. To workaround by retrying the sendkey with step control

    By exprience, this lost of Sendkey() occurs randomly. You may add a retry WHILE loop with Bitmap/OCR search control on the window to workaround. Here you may find an example :

    reference to undefined name 'syntax' Une exception de type 'MindTouch.Deki.Script.Runtime.DekiScriptUndefinedNameException' a été levée. (click for details)

     

     

     

    See also

    Was this page helpful?
    Tag page (Edit tags)
    • No tags
    Page statistics
    1922 view(s), 8 edit(s) and 9471 character(s)

    Comments

    You must login to post a comment.

    Attach file

    Attachments

    FileSizeDateAttached by 
     on-screen-keyboard.png
    No description
    34.14 kB10:52, 28 Feb 2019xjiActions
     RDP_Options.png
    No description
    29.45 kB10:52, 28 Feb 2019xjiActions