Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
menu search
person
Welcome To Ask or Share your Answers For Others

Categories

I have 4 images in a folder and need to upload all of them together into my application. I have done single file upload through selenium using sendKeys, but the multi file upload is a challenge!

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
150 views
Welcome To Ask or Share your Answers For Others

1 Answer

WebElement uploadElement = driver.findElement(By.xpath("   "));
//Single file upload
uploadElement.sendKeys("C:\foldername\abcd.png");

//Multi file upload - simultaneous
uploadElement.sendKeys("C:/foldername/firstImg.png 
 C:/foldername/secondImg.png 
 C:/foldername/thirdImg.png");

Note : needs to be preceeded with space


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
thumb_up_alt 0 like thumb_down_alt 0 dislike
Welcome to ShenZhenJia Knowledge Sharing Community for programmer and developer-Open, Learning and Share
...