I have such HTML:
<a id="buttonToUpload" class="btn-pink medium" href="#">
<span class="icon-arrow-right">upload photo</span>
</a>
<form id="form1" enctype="multipart/form-data">
<input id="uploadImage" type="file" accept="image/png, image/gif, image/jpeg, image/jpg" style="visibility: hidden">
</form>
Pressing on raise system dialog for choosing file, which I can't access via webdriver. I tried send_keys() directly to but it raises ElementNotVisibleException. So how can I upload photo there? Actual code:
driver = webdriver.Firefox()
driver.get('http://www........')
upload_input = driver.find_element_by_id('uploadImage')
upload_input.send_keys(os.getcwd()+'/image.jpg')