Nexial Automation

Test Automation Platform for everyone!

X

io » copyFiles(source,target)

Description

This command copies files from one location to other.

Since the intended target file(s) could already exist, Nexial provides a few different options to handle such condition. The System variable nexial.io.copyConfig is created for this purpose. One can define this System variable with one of the following values to alter how Nexial handle such situation:

  • keepOriginal: don’t copy file (default behaviour)
  • override: override existing file
  • backup: taking backup of existing file and copy new file

At its simplest form, one can use this command to copy a file to another location:

Another use of this command is to copy the same file to the same location under a different name:

One can also use this command to copy multiple files to another directory:

Note that if the target location does not exist, Nexial will attempt to create it on the fly.

Parameters

  • source : Full path of the files to copy
  • target : Full path of the destination

Example

Script:
script

Output:
output

See Also