Selenium Webdriver文件附件 [英] Selenium Webdriver file attachments
问题描述
是的,您可以将文件存储在eclipse项目的资源或res文件夹中,然后使用相对路径引用这些文件。在这种情况下,您将使这些文件成为您的存储库的一部分。
另一种方法是在一个共享文件夹,点中的所有文件从测试的情况下离开这些,所以在这种情况下,你并不需要将文件提交给存储库,我们曾经用大文件进行存储。
I'm doing some automated testing with selenium webdriver in eclipse. I need to attach actual files and then send them. The problem is these files can't be on my local drive since the completed tests are uploaded to a server so that they can be ran continuously and the connection to my local files will be lost causing the tests to fail. Is there a way to include these test files in the eclipse project in some folder then use the tests to attach or upload these files?
Yes, you can store the files in the resources or res folder of your eclipse project and then reference these using relative paths. In that case you will be making these files part of your repository.
Another way is to leave all the files in a shared folder and point to these from the test cases, so in that case you don't need to commit the files to the repository, we used to make that with big files.
这篇关于Selenium Webdriver文件附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!