Hi, I have a site that I am testing, that during the process flow, has to go off to File Explorer and select a spreadsheet to upload to the page.
I recorded the process and it is fine, until it gets to the file explorer screen. It opens the window, but then does not recognise anything in it. I have tried to create a new object, but it wont let me. Every time I click in the window, Katalon makes a noise and it doesn’t seem to recognise the window at all, so I have no idea on how to get the findTestObject call to work ? I have tried UploadFile, switchWindow to name a few things, but I cannot get it to work !
Has anyone else had this issue and managed to get it to work ?
File Explorer is a native Windows dialog, and Katalon Studio can’t interact with any native Windows dialog. In this case you need an additional third-party tool such as autoIT to help automate actions you need to do on File Explorer
1 Like
Can you please explain how to use autoIT foor this case
here is my code to find a file in file explorer using autoit:
@Keyword
//### upload file from windows explorer
def uploadFile (TestObject to, String filePath) {
WebUI.click(to)
StringSelection ss = new StringSelection(filePath);Toolkit.getDefaultToolkit().getSystemClipboard().setContents(ss, null); Robot robot = new Robot(); robot.delay(1000) Thread.sleep(3000) robot.keyPress(KeyEvent.VK_ENTER); robot.keyRelease(KeyEvent.VK_ENTER); robot.autoDelay; robot.keyPress(KeyEvent.VK_CONTROL); robot.keyPress(KeyEvent.VK_V); robot.keyRelease(KeyEvent.VK_V); robot.keyRelease(KeyEvent.VK_CONTROL); robot.autoDelay; robot.keyPress(KeyEvent.VK_ENTER); robot.keyRelease(KeyEvent.VK_ENTER);
}