I am trying to upload a file through Katalon. Can you explain how to do it?
Hello Tom,
For uploading the file, make use of local file detector:
WebUI.openBrowser('')
WebUI.navigateToUrl('https://angular-file-upload.appspot.com/')
WebUI.setText(findTestObject('Object Repository/Page_Angular file upload sample/input_Upload on form submit_userName'), 'lambdatest')
//-------------------------Upload using Localfile detector ----------------
EventFiringWebDriver driver = DriverFactory.getWebDriver()
RemoteWebDriver wrappedDriver = driver.getWrappedDriver() // get the driver inside the smart wait driver (remote,chrome, firefox,etc)
wrappedDriver.setFileDetector(new LocalFileDetector()) //points your remote,chrome,firefox,etc driver to the local files in the run.
WebElement El = wrappedDriver.findElement(By.xpath("//*[@id=\"editArea\"]/div/div/form/fieldset/input[2]"));
((RemoteWebElement) El ).setFileDetector(new LocalFileDetector());
El.sendKeys("COMPLETE FILE PATH");
//-------------------------------------------------------------------------
WebUI.click(findTestObject('Object Repository/Page_Angular file upload sample/button_Submit'))