Trouble with AutoItLibrary Get Clip

99 views
Skip to first unread message

Jessica P.

unread,
Mar 17, 2015, 1:56:58 AM3/17/15
to robotframe...@googlegroups.com
Hello,

I've got a test suite with three test cases at the moment.  One test case uses keyboard navigation and Get Clip to successfully validate some fields in a grid.  I copied this test case and made changes to try to validate fields in a list view, but for some reason, it doesn't seem to be getting the latest value from the clipboard.  If I stop the test run after this failure, I can paste the value I expect into a text editor, but the robot test case isn't getting the newest value.  If the clipboard is empty before this test, I get random characters in my variable instead of clipboard text.  The expected item in the list view is highlighted during this run, and like I said, I do get the right value in the clipboard since I can paste it into another app just fine.  I can't figure out why this fails.

Here's my test case:

Win Active    Source File Mapping           
Click Main Form Control    MappedPane           
Send    ^{HOME}^c           
${Result} =    Clip Get           
Should Be Equal As Strings    ${Result}    Required Fields, Data source mapped, Source key mapped

David

unread,
Mar 18, 2015, 12:59:09 AM3/18/15
to robotframe...@googlegroups.com
Timing issue perhaps? Try a delay in between the send and clip get. Also it might be useful to split the send commands one for ctrl + home & a separate command for ctrl + c, rather than lump them in the same command. A delay of at least 1 second would be good, can go up to 5 seconds if needed.

You can diagnose if this is AutoIt problem or issue with AutoItLibrary <> RobotFramework interaction by running the same test code in native AutoIt script or over some other language via AutoItX COM API (e.g. Python, VBScript). If the same steps give you same issue, then it is likely a timing issue with copying to clipboard & immediately fetching back the results.
Reply all
Reply to author
Forward
0 new messages