How do I copy a PNG files contents to the RemoteClipBoard so that it can be pasted onto the SUT?

I am working on a method to upload my results of my tests onto a website online, these include screenshots of steps within the test that were recorded using the screen capture method. I have put the images into a folder and want to be able to read from those files and paste them into the website on the SUT.
I have been able to do a similar process with reading from XML files, adding them to the RemoteClipBoard, editing them and then pasting them onto the SUT but have not found a way yet to do this with images.

Standard coding used for XML:
set fileSource to file(“filename”)
set RemoteClipboard fileSource
TypeText ControlKey, “v”

What would be a method to do this with images from Screen Capture?

Hey @dankadamski,

Here is a gift for you :slight_smile:
Make sure you have a picture with the name eggy.png in the resources folder of your epf suite.

put file resourcepath("eggy.png") as base64 into myfile
set the remoteclipboard to myfile

typetext windowskey, "r"
typetext "notepad", returnkey
wait 2 // let notepad start
typetext controlkey,"v" // paste clipboard content
typetext controlkey,"s"
typetext "CmdEggy.txt", returnkey
typetext altkey,F4
typetext windowskey, "r"

typetext cmd, returnkey
typetext <<certutil -decode "C:\Users\eggplant-admin\Desktop\cmdeggy.txt" "C:\Users\eggplant-admin\Desktop\cmdeggy.png">>,returnkey

1 Like

Great, so I got this to add the .png file onto my SUT!
Is there a way to add the image to the clipboard of the SUT without having to automate finding the image on the SUT and then copy and pasting it?
I have multiple images that I want to paste into the website and this would make it significantly faster

Hey @dankadamski,

In case you have multiple images and need to use them on your SUT. Here are some options you have as copying of binary files via remoteclipboard is not support at the moment.

  • Use a network drive which is also accessible from your SUT
  • Use oneDrive or any equivalent cloud storage that can be mounted as drive/folder on the SUT
  • if you know the file locations already use EPF to create these path. put them into the remoteclipboard and paste them into the file upload dialog for faster manoeuvring in these dialogs.
  • paste the full path directly in the name field of the upload dialog. hit enter
  • you can open the windows Explorer with a defined path via cmd or windows run menu (windoskey,“r”). explorer.exe /e,C:/Temp as an example. afterwards select all the files you want in the clipboard, add them to clipboard (controlkey,“c”) go back to chrome past them.

Hope any of the above options works for you. In case not, explain a bit more which steps you perform with screenshots or a short video /gif.
Feel free to create a featureRequest for the binary file copying via remoteclipboard on craft.io. Your account manager should be able to help you with this.

Cheers,
Karsten