I ran this code while having a SUT open with an application running and a cursor in a textbox containing the highlighted word “Hello”. When I run this code, the output is as expected. If I run it a second (or more) time, the output is “empty”. This is happening in other scripts as well.
FAILURE Screen_Error.png Error Running Script Command remoteclipboard Error -
No new clipboard info retrieved within 2.00 seconds
– Execution Time 0:00:04 Automated_Tests/Vertical_Regression/Untitled1.script
This is my script now:
Repeat 2 times
SetRemoteClipboard "empty"
Wait 2
TypeText controlKey, "c"
Log RemoteClipboard(2)
End Repeat
Again, the SUT simply contains an open notepad document containing the word “Hello”.
You need to add wait after “Typetext controlkey,c”. Currently the issue is because, you have hard wait before the copy & trying to look at clipboard previous 2 seconds . Since there is no data in clip board, it should return empty.
Try once adding wait 3 after copy.
Repeat 2 times
SetRemoteClipboard “empty”
TypeText controlKey, “c”
Wait 2
Log RemoteClipboard(2)
End Repeat
Secondly , check the windows rdpclip.exe is running, if any process killing this will cause clipboard not to work. You can start this just by enter this in run window before execution.
Did you have any luck with clearing the contents of the clipboard before the next value is entered ?
I am facing an issue where the clipboard contains stale values for next time when a value from clipboard is compared with a value entered in the input field it returns an error because the match is done against a stale value(which should have been cleared).