How can I upload multiple files at a same time using Auto IT, Because in my code it upload only 1 file at a time.Please suggest me answer .

Code-

ControlFocus(“Open”,””,’Edit1′)
ControlSetText(“Open”,””,’Edit1′,”””C:\Users\AAgrawa1\Desktop\DRMI_NEW\Resume\ambu.doc””” “””C:\Users\AAgrawa1\Desktop\DRMI_NEW\Resume\ambu1.doc”””)
ControlClick(“Open”,””,’Button1′)

 

Eclipse-

package Ali;

import java.io.IOException;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class Snippet {
public static void main(String[] args) throws IOException, InterruptedException {

System.setProperty(“webdriver.chrome.driver”,”C:\\Users\\AAgrawa1\\Downloads\\chromedriver_win32\\chromedriver.exe”);

WebDriver driver = new ChromeDriver();
driver.get(“http://demo.guru99.com/test/upload/”);

driver.findElement(By.id(“uploadfile_0”));

// enter the file path onto the file-selection input field
Runtime.getRuntime().exec(“C:\\Users\\AAgrawa1\\Desktop\\DRMI_NEW\\Resume\\FileUpload.exe”);
// Runtime.getRuntime().exec(“C:\\Users\\AAgrawa1\\Desktop\\DRMI_NEW\\Resume\\Fileuploadaa.exe”);
// check the “I accept the terms of service” check box
driver.findElement(By.id(“terms”)).click();

// click the “UploadFile” button
driver.findElement(By.name(“send”)).click();

}
}

 

 

 

 

 

 

Default Asked on September 10, 2018 in Selenium WebDriver.
Add Comment
  • 0 Answer(s)
  • Your Answer

    By posting your answer, you agree to the privacy policy and terms of service.