Reputation: 1397
I am trying to automate a requirement, where I have to drag images(jpeg or png) form a file and drop it to browser. I am using Selenium Web Driver as automation tool with JAVA, I tried but selenium doesnt support anything outside browser.
I need help can anyone guide me how can I automate this.
Upvotes: 1
Views: 6661
Reputation: 588
If your trying to drop your image into some sort of input you could try this. I used this to upload files with selenium.
WebElement inputField = driver.findElement(By.xpath("//*[@id='MyInputField']");
inputField.sendKeys("path to image");
Hope this helps.
Upvotes: 1
Reputation: 34895
You would not be able to do this using selenium. The selenium bindings have access to the browser instance (the WebDriver
) but to nothing outside of it.
Upvotes: 3