In your tests, you may often need to work with files on your hard drive. For example, to read files, write data to files, find a file, compare files, get file properties, and so on.
If you use DelphiScript, you can use its native file operations built into TestComplete. See DelphiScript Routines.
If you use any other supported scripting language, for example, JavaScript, JScript, Python, VBScript and so on, you can:
-
Use Windows Scripting Host to create a file object via OLE, and then use this object to work with the file. See the documentation on the
File
object in the MSDN Library: -
Use functions provided by the
aqFile
andaqFileSystem
objects that are available in all the supported scripting languages.
This section provides several examples of working with files from scripts.