Data Copy New Feature

EggPlant is a great product. However to me to complete it, it does need some way of transfering data from Eggplant to VNC machine.

This can’t be done as yet can it? :smiley:

Hello Stuart,

The VNC protocol that Eggplant uses to communicate with the SUT doesn’t provide a mechanism for transferring data (other than the clipboard contents, which can be shared in both directions). However, there are at least a couple of ways that data files can be copied across the connection.

Mount the File System
The nicest way to go about transferring data between the Eggplant machine and the SUT is to mount the SUT’s file system over the network. The Mac networks very nicely with other computers so this is usually pretty easy to do. Once the network file system connection is established, the remote files are visible locally and can be accessed in your scripts just like local files.

SenseTalk provides lots of facilities for working with files (see the chapter on “Working with Files and File Systems” in the SenseTalk Reference manual). Copying a file as you requested could be done with the “copy file” command like this:

copy file “/path/to/local/file” to file “/path/to/remote/destination”

Use Unix Commands
If mounting the remote file system is not feasible for some reason in your case, another approach would be to use one of the tools available from the Unix command line to copy the file. The SenseTalk shell() function enables you to run Unix commands. This would allow you to use scp or ftp or whatever to copy the file.

Use the Clipboard
If the data in question is text and is relatively small, you could also use VNC’s clipboard support to transfer it. Use Eggplant’s SetRemoteClipboard command to transfer the data to the clipboard on the SUT. If the local data is in a file, you can read the file and transfer it with a single command:

SetRemoteClipboard file “/path/to/local/data/file”

Then script the operations on the SUT to paste the data into a text editor and save it out to a file (or whatever you need to do with the data). I didn’t suggest this first, because using the clipboard may not work well for large amounts of data. With a little bit of scripting work you could break the data up into smaller chunks, though, and copy them sequentially, reconstructing the data at the other end.

To transfer data in the other direction, you would use Eggplant to copy the data to the clipboard on the SUT (e.g. open the file, select the text, and copy it). Then use Eggplant’s RemoteClipboard() function to read the data in your script, and write it out to a file. Again, this part could be as simple as a single line in your script:

put the remoteClipboard into file “/path/to/local/file”

I hope one of these options works for you. If not, feel free to ask more how-to questions, either on the regular support forum or by email.