2017-04-14 103 views
0

我有一個連接件:如何上傳文件機器人框架,關鍵字「選擇文件」

<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是正確的。請幫我解決這個問題!

回答

2

C:\\Users\\NTQ\\My Pictures\\images.png這是您正在使用的路徑。 "My Pictures"之間的空間是它的原因。儘量保留圖像的路徑,不應在任何單詞之間包含空格。

+0

我用腳本再試一次: '選擇文件id = c97 C:\\ images.png' 它工作不正確。該測試用例已經傳遞了該文件沒有附加的按鈕。 :( –

+0

通常,不喜歡包含數值的id(locator)。因爲它可能會動態地改變。選擇一些其他的定位器,如jQuery或任何其他 –

相關問題