Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Vaadin Upload File Path from Testing using Selenium

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();
like image 854
jimmyboix Avatar asked Aug 10 '26 02:08

jimmyboix


1 Answers

This got it working

getDriver().findElement(By.xpath("//input[@type='file']")).sendKeys("/tmp/test.xlsx"); 
$(UploadElement.class).first().findElement(By.className("v-button")).click();
like image 75
jimmyboix Avatar answered Aug 12 '26 16:08

jimmyboix



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!