From the course: Robot Framework Test Automation: Level 1 (Selenium)

Unlock this course with a free trial

Join today to access over 24,900 courses taught by industry experts.

Operating system: Folders and files

Operating system: Folders and files

I personally find the operating system library to be very valuable for doing test automation. Since it comes with the built in libraries from Robot Framework, there is nothing to install. And this library gives you the ability to manipulate files and directories, environment variables, things like that. So with files you can create, copy, move, delete, read, write, append. You can get a list of files in a directory. You can get and set modified times for files, and that includes doing variable date time formatting, if you wish. You can split the extension from a file name so you can get either the name of the file or the extension. For directories, you can create, copy, move, and delete. You can count files within a directory. You can ask that the directory should be empty. You can list a directory, so you know how many directories are inside another directory. And again, you can split the path for a directory, so you can break out the various chunks of the path. You can get and set…

Contents