I'm getting the error below when using "send_keys" for a choose file button in selenium in Python, using Chrome Driver:
webDriverException: Message: unknown error: cannot focus element
After some research, I tried to use the action chain method:
actions = ActionChains(self.driver)
actions.move_to_element(e)
actions.send_keys("C:\Users\devuser\Desktop\Untitled.png")
actions.perform()
This executes with no error, however, the file is not uploaded. Any idea how to solve this issue? Thanks.
Update: The html is below:
<div class="qq-upload-button" style="position: relative; overflow: hidden; direction: ltr;">Upload Image
<input multiple="multiple" type="file" name="file" style="position: absolute; right: 0px; top: 0px; font-family: Arial; font-size: 118px; margin: 0px; padding: 0px; cursor: pointer; opacity: 0;">
</div>