My project tree
Project
JavaRessources
src/test/java
myclass.java
DeployedRessources
webApp
myFile.txt
in my class.java i want to upload myFile.txt with selenium webdriver:
driver.findElement(By.id("upload1")).sendKeys("myFile.txt");
when i do :
private void verifyFile(final String myId, final String src) {
final WebElement file = this.driver.findElement(By.id(myId));
final String value = file.getAttribute("value");
assertEquals("name of uploaded file: ", src, value);
}
verifyFile("upload1", "myFile.txt");
it return : name of uploaded file: expected: [myFile.txt] but was []
so i dont know how to use relative path to upload this file with seleniumWebDriver
Thanks