您可以在硒中使用send_keys一次上传两个文件吗?
我正在尝试将两个文件上传到网页上的元素中 - 但是,成功上传一个文件并尝试上传另一个文件后,我会收到以下错误:
发生了例外:StaleelementReferenceException 消息:陈旧元素参考:元素未连接到页面文档
因此,我想知道是否有一种可以同时上传两个文件的方法。尽管这无效,但它会奏效:
uploadFiles.send_keys("C:\\Users\\jack_l\\Desktop\\IMAGES\\"+str(image) and "C:\\Users\\jack_l\\Documents\\Image-Line\\FL Studio\\Projects\\finished\\UPLOAD\\"+str(file))
任何帮助将不胜感激。
I'm trying to upload two files into an element on a webpage – however, after successfully uploading one and trying to upload the other, I get the following error:
Exception has occurred: StaleElementReferenceException
Message: stale element reference: element is not attached to the page document
So, I was wondering if there was a way to upload two files at the EXACT same time. Although this doesn't work, it would work something like:
uploadFiles.send_keys("C:\\Users\\jack_l\\Desktop\\IMAGES\\"+str(image) and "C:\\Users\\jack_l\\Documents\\Image-Line\\FL Studio\\Projects\\finished\\UPLOAD\\"+str(file))
Any help would be appreciated.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
应该将两个文件发送到输入标签。
\ n将每个文件路径分开。
Should send two files to an input tag.
\n seperates each file path.