導航:首頁 > 文件教程 > selenium2上傳文件

selenium2上傳文件

發布時間:2022-12-22 07:38:42

⑴ robot framework上傳文件的文件路徑

choose file

官方給定的解釋如下:

Source:
Selenium2Library <test library>
Arguments:
[ locator | file_path ]
Inputs the `file_path` into file input field found by `identifier`.
This keyword is most often used to input files into upload forms. The
file specified with `file_path` must be available on the same host where
the Selenium Server is running.
Example:
Choose File my_upload_field /home/user/files/trades.csv

一開始以為進入到上傳頁面,點擊瀏覽,再使用choose file,結果發現,這個函數包含了 點擊瀏覽--選中文件 那麼點擊瀏覽就是多餘的操作了

在該頁面,就只需要執行choose 就可以將圖片選中,執行的具體命令為:

choose file xpath=//div[@class='pd6 dot fcb']/span/input
C:\\Documents and Settings\\zhouxuan\\My Documents\\My
Pictures\\bug5.png

其中xpath為選中瀏覽圖標的路徑,而 C:\\Documents and Settings\\zhouxuan\\My Documents\\My Pictures\\bug5.png(此處的\\為轉義用,當只用\時會出現錯誤)則為需要上傳的圖片的路徑。

該操作執行完畢後,則會顯示為:

圖片已經順利載入進來了,後續的操作就很簡單了。

閱讀全文

與selenium2上傳文件相關的資料

熱點內容
蘋果手機密碼6位變4位 瀏覽:651
編程如何讓人物踢球 瀏覽:884
win10防藍光軟體下載 瀏覽:983
qq群文件容量 瀏覽:164
有什麼網站驗證pr 瀏覽:186
如何拍攝飄浮照片教程 瀏覽:366
劍靈白青版本刺客 瀏覽:965
卡車在哪個app可以接單 瀏覽:526
怎麼讀編程文檔java 瀏覽:501
基礎資料庫和半導體哪個好 瀏覽:118
word顯示隱藏標記 瀏覽:63
win10f4麥克風設置 瀏覽:426
昆明碼高少兒編程在哪裡 瀏覽:508
雲資料庫哪個牌子好 瀏覽:479
掃描文件多高解析度 瀏覽:487
蘋果手機js指得是什麼 瀏覽:225
編程適合什麼筆記本 瀏覽:783
c讀文本到資料庫 瀏覽:981
2010word文字背景顏色怎麼去掉 瀏覽:515
網路安全情況核查台賬是什麼 瀏覽:590

友情鏈接