51Testing软件测试论坛

标题: selenium解决IE上文件上传过程 [打印本页]

作者: xiaozhi87097721    时间: 2012-2-6 11:29
标题: selenium解决IE上文件上传过程
求解:用selenium怎么写上传文件过程?要在IE上跑的,firefox直接写路径就可以,IE不行,要怎么解决?
作者: pl80601983    时间: 2012-2-7 09:50
回复 1# xiaozhi87097721

这个问题在《开源测试工具》版块中有体现,现在我引用一下云层的回复给你吧!

找到一个解决的方法,因为js不允许修改<input type="file">这类表单,所以最后的type是没法实现的,现在只有在Selenium RC模式下用*chrome模拟,而core模式要等他们修复bug了。

原文
can't seem to use Selenium Core to upload a file; when I try to type in the file upload text field, nothing happens!

    Unfortunately, this is yet another JavaScript security restriction; JS is not allowed to modify the value of <input type="file"> form fields. You can work around this by running your tests under Selenium IDE or under Selenium RC running in the experimental "*chrome" mode for Firefox, but at present there is no way to do this on any other browser. This is filed as bug SEL-63, but there may be no way to fix it in Selenium Core.





欢迎光临 51Testing软件测试论坛 (http://bbs.51testing.com/) Powered by Discuz! X3.2