Vaadin上传使用硒测试的文件路径 [英] Vaadin Upload File Path from Testing using Selenium

查看:71
本文介绍了Vaadin上传使用硒测试的文件路径的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这不会在硒中设置Vaadin上载组件的文件路径的任何原因.

Any reason why this wont set the file path for the Vaadin Upload Component in selenium.

文件路径保持不变,单击时尝试上载null.该文件确实存在于我的本地目录中.

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

推荐答案

这使它正常工作

getDriver().findElement(By.xpath("//input[@type='file']")).sendKeys("/tmp/test.xlsx"); 
$(UploadElement.class).first().findElement(By.className("v-button")).click();

这篇关于Vaadin上传使用硒测试的文件路径的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆