场景是这样的:
1,先登录百度
2,点击上传本地文件
实际场景是点击上传本地文件的按钮后才会出现选定文件的框框
我根据实际场景写了这几行代码:
window=driver.find_element_by_xpath(".//[@id='WKFlashUploader']/embed").click() //点击上传文件按钮
window.send_keys("C:UsersliliDesktopbaidu.txt")//
报了这样的错误
教程是这样的:
哪里不对劲呢
PHP中文网2017-04-18 10:31:38
.After click(), the window is the return result of the click() method. If there is no return, the window is None and cannot send_keys
PHP中文网2017-04-18 10:31:38
First check the window handle to be empty. If it is empty, it will not be processed