In this video will see how to upload any file without using any third-party tool like autoIt or Sikuli. We can do this by using send keys() function.
I hope you like this video. For any questions, suggestions or appreciation please contact us at: https://programmerworld.co/contact/ or email at: programmerworld1990@gmail.com
public static void main(String[] args) {
// TODO Auto-generated method stub
System.setProperty("webdriver.chrome.driver", "C:\\Ulearning\\chromedriver-win64\\chromedriver-win64\\chromedriver.exe");
ChromeOptions op = new ChromeOptions();
op.setBinary("C:\\Ulearning\\chrome-win64\\chrome-win64\\chrome.exe");
op.addArguments("--remote-allow-origins=*");
WebDriver driver = new ChromeDriver(op);
driver.get("https://programmerworld.co/selenium-test-page/");
WebElement chooseFile = driver.findElement(By.name("file-70"));
chooseFile.sendKeys("C:\\UCode\\demo.docx");
}