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

熱點內容
mfrc522射頻識別參考程序注釋new 瀏覽:363
手機儲存相機照片文件管理找不到 瀏覽:507
天刀詞綴升級被鎖 瀏覽:956
安化哪裡可以學編程 瀏覽:716
純文本文件和二進制文件 瀏覽:216
如何把網路玩起來 瀏覽:654
錄視頻文件特別小的軟體 瀏覽:75
vivo隱藏文件夾在哪裡設置 瀏覽:790
都有哪些圈錢APP 瀏覽:434
javaweb開發pdf 瀏覽:313
ps保存文件特大 瀏覽:46
網路和編程哪個更吃香 瀏覽:583
神武用過的賬號都在哪個文件夾里 瀏覽:70
對於初學者用什麼編程語言比較好 瀏覽:470
吉林環保文件櫃值多少錢 瀏覽:111
1607版本win10 瀏覽:968
如何使文件不能復制 瀏覽:96
matlabr2017a安裝教程 瀏覽:287
access資料庫查詢生成表 瀏覽:661
nodejsforever配置 瀏覽:181

友情鏈接