我是selenium的新手,我有一个脚本可以将文件上传到服务器.
在ide版本中说它上传文件,但当我导出测试用例为python 2/unittest/webdriver时,它不会上传它..
它不会给我任何错误,只是不上传它...
python脚本是:
driver.find_element_by_id("start-upload-button-single").click()
driver.find_element_by_css_selector("input[type=\"file\"]").clear()
driver.find_element_by_css_selector("input[type=\"file\"]").send_keys("C:\\\\Documents and Settings\\\\pcname\\\\Desktop\\\\ffdlt\\\\test.jpeg")
Run Code Online (Sandbox Code Playgroud)
我搜索了解决方案,但除了将其与AutoIt或AutoHotKey集成之外,我还没有找到任何解决方案......
第一行打开Firefox的文件上传框.