Hi,
I am using the following to download a PDF off a site and verify the file has downloaded with the correct name;
name = WebUI.getText(findTestObject(‘TEST OBJECT’))
println(name + ‘.pdf’)
File downloadFolder = new File(‘C:\\\Downloads’)
List namesOfFiles = Arrays.asList(downloadFolder.list())
if (namesOfFiles.contains(name + ‘.pdf’)) {
println(‘Success’)
} else {
WebUI.verifyTextPresent(‘This Test Case Has Failed’, false)
}
But I can’t figure out how to get Katalon to delete the file before completing the Test Case.
Obviously, I can do it manually but that’s not why any of us are here.
Thanks in Advance!