Return to site

Upload file in selenium webdriver using autoit with web

broken image

Sending file name as the argument to the input tag WebElement searchBox= driver.findElement(By.id(“files”)) Locating input tag which as type as file. tProperty(“”,”./exefiles/chromedriver.exe”) ĭriver.get(“file:///C://Users//Stestingo//Desktop//FileUpload.html”) Public static void main(String args) throws IOException Here is the below code for the above scenario: import java.io.IOException For this, we are going to use the sendkeys() method by which we are going to send the file path details to the file path name text box. Now we are trying to do the same operation using the same webdriver. Once the file is upload successfully, the file is displayed beside the choose file button. When you click on choose files, a dialogue box will open, and in that file name text box, we have to enter the absolute file path in the file name text box, after that click on the open button. Not to perform a “Click” action to launch the file dialogue

broken image

The file’s path must be the absolute path The file textbox properties must be “Enabled” & “Visible.”

broken image