'Katalon: Custom keyword working when executing on Chrome but not on Firefox
I have this custom keyword that waits until a file is downloaded and then deletes the file, the thing is that in chrome works okay but when I execute in firefox I get an error.
@Keyword
public verifyDownloadedFile2(String downloadPath, String fileName, timeOut) {
int counter = 0
boolean fileExist = new File(downloadPath + fileName).exists()
while(!fileExist == true) {
if(counter != timeOut) {
WebUI.delay(1)
fileExist = new File(downloadPath + fileName).exists()
counter++
}
else if(counter == timeOut){
throw new Exception("File was not downloaded within" + timeOut + " seconds.")
}
}
File dir = new File(downloadPath);
File[] dirContents = dir.listFiles();
if (dirContents.length > 0) {
for (int i = 0; i < dirContents.length; i++) {
dirContents[i].delete();
}
}
assert fileExist == true
}
This is the error:
=============== ROOT CAUSE ===================== Caused by: org.codehaus.groovy.runtime.metaclass.MissingMethodExceptionNoStack: No signature of method: windows.interactions.deleteFile2() is applicable for argument types: (java.lang.String, java.lang.String, java.lang.Integer) values: [F:\Downloads\Katalon_Studio_Windows_64-8.1.0\Data\Temp, ...]
Sources
This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.
Source: Stack Overflow
| Solution | Source |
|---|
