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

熱點內容
pdf文件名怎麼換顏色 瀏覽:868
核桃編程如何退錢 瀏覽:17
如何查看預約app 瀏覽:774
數控哪個編程軟體速度最快 瀏覽:135
qq表情白眼是哪個 瀏覽:965
shell循環文件名 瀏覽:602
照片3d建模源代碼 瀏覽:434
西安iPhone6升級內存 瀏覽:84
小學生的編程的課是學什麼的 瀏覽:114
就業下載什麼app 瀏覽:191
個人配置文件重定向到D盤 瀏覽:22
js屏幕寬度 瀏覽:312
sql查找某列重復資料庫 瀏覽:48
智行火車票用微信支付 瀏覽:262
網路定價過程哪些內容發生變化 瀏覽:200
dubbo服務提供者的配置文件 瀏覽:182
win8系統如何壓縮文件 瀏覽:875
網站怎麼上傳代碼 瀏覽:4
java日誌的好處 瀏覽:103
武漢奇米網路怎麼樣 瀏覽:689

友情鏈接