问题
Any reason why this wont set the file path for the Vaadin Upload Component in selenium.
The file path remains unset and when the click happens it trys to upload null. The file does exist in my local directory.
$(UploadElement.class).first().findElement(By.className("gwt-FileUpload")).sendKeys("/tmp/test.xlsx");
$(UploadElement.class).first().findElement(By.className("v-button")).click();
回答1:
This got it working
getDriver().findElement(By.xpath("//input[@type='file']")).sendKeys("/tmp/test.xlsx");
$(UploadElement.class).first().findElement(By.className("v-button")).click();
来源:https://stackoverflow.com/questions/35658831/vaadin-upload-file-path-from-testing-using-selenium