如何使用selenium2library和Robot Framework从Windows目录上载文件 [英] How to Upload file from windows directory using selenium2library and Robot Framework
问题描述
有人可以帮我如何使用selenium2library和Robot Framework从Windows目录上载文件.我曾尝试在selenium2library中使用选择文件"命令,但由于文件在本地文件系统中不存在而出现错误.不考虑目录路径或任何其他问题.请给我有效的代码或任何其他解决方案.我们将不胜感激.以下是我尝试过的命令
Can someone help me How to Upload file from windows directory using selenium2library and Robot Framework.I have tried using Choose File command in selenium2library but I am getting error as File doesn't exist in local file system.I am not sure whether directory path is not considered or any other issue. Please give me valid code or any alternate solution.Any help would be appreciated.Following is the command I have tried
Choose file xpath = //input[@firmware-upgrade='firmware'] /Downloads/Cambium_Builds/Falcon/ePMP1000-Hotspot-2.5.1-b3.tar
HTML标记为`
`
推荐答案
感谢大家的回答和时间,但幸运的是,以下脚本帮助我从Windows上传了文件,并且运行正常.使用AutoIT也是一样,但是我已经尝试了一切.
Thanks every one for your answers and time,but luckily following script helped my uploading a file from windows and its working fine.There might be different options to perform the same using AutoIT but I have tried with whatever i know.
***Settings***
Library Selenium2Library
*** Variables ***
${Browser_Chrome} Chrome
${Device_77_URL} https://10.110.0.17
${Device_Path} C:\\Users\\mra001\\Downloads\\Builds\\Gambit\\500-2.5.1-b3.img
*** Keywords ***
Software Update
Open Browser ${Device_77_URL} Chrome
Input Text id=Username admin
Input Text password=Password admin
Click Button xpath = //button[@type='submit']
Wait Until Element Is Visible //a[text()='Home'] 20
Click Link xpath = //a[text()='Operations ']
Input Text xpath = //input[@firmware-upgrade='firmware'] ${Device_Path}
Click Button Upgrade Firmware
Sleep 70
Confirm Action
Close Browser
这篇关于如何使用selenium2library和Robot Framework从Windows目录上载文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!