導航:首頁 > 文件教程 > 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上傳文件相關的資料

熱點內容
微信1元3包紅包尾數概率分析 瀏覽:799
如何改變網站名稱 瀏覽:919
熊貓看書哪個文件夾 瀏覽:650
win10勒索文件保護設置 瀏覽:842
arcgissde93安裝教程 瀏覽:487
xml文件注釋快捷鍵 瀏覽:878
extjs的配置文件怎麼配置重定向 瀏覽:740
access資料庫查看aspx 瀏覽:154
數控編程如何減少時間 瀏覽:779
蘋果FLAC屬性 瀏覽:642
硬碟評分工具 瀏覽:734
為什麼e福州app登不上 瀏覽:963
jsfoutputlink 瀏覽:472
哪個網站可以聽南音 瀏覽:264
蘋果裝系統裝win7驅動 瀏覽:686
php判斷file是否有文件 瀏覽:979
和平精英使用什麼編程開發 瀏覽:102
f3文件 瀏覽:523
快手3d環繞音樂用什麼app 瀏覽:376
linux新增一個文件 瀏覽:440

友情鏈接