Veryfing that files/folders has been created on SUT


as a newbie I got first problem that I cannot solve by myself + EP Reference :wink:

Test script created has to do simple installation process of tiny application. As a verification of such test case script should not only notice if install wizard window is closed after installation process but also it should check if appropriate files/folders has been created on appropriate path on HDD.
As I’ve searched SenseTalk manual, files and folders function allow only to check only on driver machine not SUT one. So what will be the easiest way to verify if everything is in place after installation?

Thanks in advance for any suggestions :slight_smile:


The easiest thing to do would be to mount the file system of the SUT on the Eggplant machine. Then you can use the SenseTalk file system features to check that the filles are present.

if file "/path/to/file" does not exist
    logError "file not found"
end if

Otherwise, you’ll need to create a script that goes through the Finder or Explorer (or whatever file viewer is available on the sut) using the standard image-based approach and just look for the names of the files.

Using SenseTalk solution you’ve shown would it be a problem if SUT filesystem is NTFS?

No, that should not make a difference. As long as you can mount the drive, I think Eggplant will be able to access it.

Generally, reading files from NTFS should work fine. But you may run into issues with line endings in the file. Currently, when reading a file’s contents, SenseTalk assumes that lines in a file are separated by linefeed characters (the Mac OS X and Unix standard). Usually Windows files use CRLF line endings (with both a carriage return and a linefeed character at the end of each line).

So if you read a Windows file like this, you’ll get carriage return characters included at the end of each line:

put each line of file "/some/windows/file" into listOfLines

Instead of using the “line” chunk type, you can read the file and split it into a list like this:

put file "/some/windows/file" split by CRLF into listOfLines

Or if you prefer to work with it as lines of text rather than a list, you can do this:

put file "/some/windows/file" into text
replace every CRLF in text with Return

If you’ll be modifying the text and writing it out again, be sure to replace the returns with crlf again before you write it out.