我正在使用Selenium IDE为我的Webapp制作自动化测试用例。
场景-测试文件上传。
目录结构:-
myapp/
testsuite/
Resources (contains csv upload file)
folder for testsuit(contains testsuit and relevent testcase files)
问题-当前,我正在本地计算机上制作测试服,因此要上传的文件的路径对于我的系统而言是本地的。现在,如果任何其他团队成员在其系统/服务器上运行测试服,则需要更改上传文件的路径。但这是更改每个系统路径的一种不好的做法。因此,我正在尝试使上传文件的路径相对于我的测试服文件的位置。
<tr>
<td>type</td>
<td>id=QuestionUpload_file</td>
<td>/home/sbl4/public_html/atumbarium/testsuite/resources/question_upload.csv</td>
</tr>
我尝试了以下文章中指定的方法:-您可以使用Sel-Blocks Selenium附加组件为数据文件指定“相对”路径吗?
免插件解决方案:
<tr>
<td>storeEval</td>
<td>Preferences.getString(TestSuite.TEST_SUITE_DIRECTORY_PREF);</td>
<td>testSuiteFolder</td>
</tr>
<tr>
<td>type</td>
<td>id=QuestionUpload_file</td>
<td>${testSuiteFolder}/resources/question_upload.csv</td>
</tr>
无需配置。
本文收集自互联网,转载请注明来源。
如有侵权,请联系 [email protected] 删除。
我来说两句