admin管理员组文章数量:1403493
I am trying to automate a file upload using selenium module in Python, I am able to click the "Attach" button and upload file from absolute path but getting error as file upload is not finished yet. Here is code example and errors , though same code is working fine when I am running in debug mode.
Code Snippet :
file_input = WebDriverWait(driver, 10).until(
ec.presence_of_element_located((By.ID, "fileToUpload"))
)
# Path to the file you want to upload
file_path = "C:/user/file.pdf"
print(file_path)
# Send the file path to the input element
file_input.send_keys(file_path)
time.sleep(10)
Attach Button :
Error :
Failing while loading this progress bar :
Is there any way I can put a wait in send_keys itself rather than later on while file is getting uploaded ?
本文标签: Python Selenium sendkeys is not waiting for file to be uploadedStack Overflow
版权声明:本文标题:Python Selenium send_keys is not waiting for file to be uploaded - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744358691a2602435.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论