I am trying to automatically select a file into an upload prompt. Here is the code for the upload section of the website.
<input name="__RequestVerificationToken" value="rAyNscZYeYLEYTV1rodwr0lQr_0Eadpfd11lcuHUvJf83lM57R2vruocFLDPjK0axYr_XBYgqmgTXVH_V2qHGFpAq-zGx_mMm72XIUj4Z6HlUjcyz47Vepfjysur7CR0N8xgHMkjW1KRgb4K6w6VPQ2" type="hidden">
<li>
<input id="imageUpload" class="hideupload" name="imageUpload" multiple="" type="file">
<a id="imageUploadLink" href="#"><i class="addContent_icon uploadlink"><img src="/Content/images/addContent-icon-images.png"></i>Upload Images</a>
</li>
The element of interest as far as I can tell is id: imageUploadLink. Clicking that will open the prompt to select file. Here is my code.
require "selenium-webdriver"
browser = Selenium::WebDriver.for :firefox
sign_in(browser, myUsername, myPassword) #signs into testing site
browser.find_element(:id, 'imageUploadLink').click
element = browser.find_element(:id, 'imageUploadLink')
element.send_keys "/Users/DanielScarlett/Desktop/Example.JPG"
send_keys seems to be typed into the bottom of the browser in a sort of find section that disappears quickly: https://i.stack.imgur.com/y6QWr.jpg
I have tried many different ways to implement this, and nothing seems to work. Also, couldn't find anything anywhere to handle this.