Vaadin Upload File Path from Testing using Selenium

匿名 (未验证) 提交于 2019-12-03 01:39:01

问题:

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(); 


标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!