Aug 22, 2019 in Selenium
Q: How to Upload a file in Selenium WebDriver?

2 Answers

0 votes
Aug 22, 2019

There are two cases which are majorly used to upload a file in Selenium WebDriver such as using SendKeys Method and using AutoIT Script.

0 votes
Mar 30
You can achieve this by using sendkeys() or Robot class method. Locate the text box and set the file path using sendkeys() and click on submit button

Locate the browse button

   WebElement browse =driver.findElement(By.id("uploadfile"));

Pass the path of the file to be uploaded using sendKeys method

    browse.sendKeys("D:\\SeleniumInterview\\UploadFile.txt");

Related questions

0 votes
Aug 22, 2019 in Selenium
0 votes
Aug 22, 2019 in Selenium
...