简体   繁体   中英

Testing html5 file upload with Capybara/Selenium?

I'm writing an application which uses html5 file upload capabilities, that is to say a user can drag&drop a file from his desktop in a div an it will be uploaded with jquery.filedrop .

Anyone knows if it's possible to test it with capybara/selenium?

I am testing this with Selenium WebDriver.
it looks like:

WebElement element = driver.findElement(By.name("source"));
WebElement target = driver.findElement(By.name("target"));

(new Actions(driver)).dragAndDrop(element, target).perform();

more about Selenium WebDriver

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM