如何上传文件机器人框架,关键字“选择文件”
问题描述:
我有一个连接件:如何上传文件机器人框架,关键字“选择文件”
<span style="position: relative; z-index: 1;"> <button class="attachment__browse" type="button" data-l10n-id="record_save_choose_file" id="c97" tabindex="10">Attach File</button> </span>
而且我写的脚本文件附加为:
Wait Until Page Contains Element id=c97
Choose File id=c97 C:\\Users\\NTQ\\My Pictures\\images.png
一点也没有” t工作并显示错误:
File 'C:\Users\NTQ\My Pictures\images.png' does not exist on the local file system.
我确定locator和file_path是正确的。请帮我解决这个问题!
答
C:\\Users\\NTQ\\My Pictures\\images.png
这是您正在使用的路径。 "My Pictures"
之间的空间是它的原因。尽量保留图像的路径,不应在任何单词之间包含空格。
我用脚本再试一次: '选择文件id = c97 C:\\ images.png' 它工作不正确。该测试用例已经传递了该文件没有附加的按钮。 :( –
通常,不喜欢包含数值的id(locator)。因为它可能会动态地改变。选择一些其他的定位器,如jQuery或任何其他 –