Hello,
I would like to know How to copy an excel file (c:\Data\example.xls) from one directory to another directory (c:\files)
and then delete the file that is in c:\Data directory.
Thanks
Hello,
I would like to know How to copy an excel file (c:\Data\example.xls) from one directory to another directory (c:\files)
and then delete the file that is in c:\Data directory.
Thanks
Here are the 2 keywords:
@Keyword
public boolean copyFile(String directorioOrigen, String archivoOrigen, String directorioSalida, String archivoSalida) {
def src = new File(direcOrigin+ fileOrigin)
def dst = new File(direcDestination+ fileDestination)
dst << src.bytes
}
@Keyword
def deleteFile(String direcOrigin, String fileOrigin){
def file = new File(direcOrigin+ fileOrigin)
file.delete()
}
Then I can use the keywords in a testcase:
def direcOrigin
def fileOrigin
def direcDestination
def fileDestination
direcOrigin=‘C:\Origin\’
fileOrigin=‘data.xls’
direcDestination=‘C:\Destination\’
fileDestination=‘data.xls’
CustomKeywords.‘package.Helper.copyFile’(direcOrigin, fileOrigin, direcDestination, fileDestination)
CustomKeywords.‘package.Helper.deleteFile’(direcOrigin, fileOrigin)