My current project involves automating the uploading of an HTML file.
Unfortunately, the website I am working on has made this task more complicated than necessary.
The code for the file upload section is as follows:
<div class="form-row">
<div id="fileupload" class="fileupload">
<div class="c-position-relative margin-vertical10">
<ul id="loaded-files" class="upload-image-thumbs clearfix loaded-placeholder">
<li class="upload-placeholder upload-image">
<div class="uploadedImg"></div>
</li>
[...Other li elements listed here...]
</ul>
<div id="upload_btn" class="c-green-button c-rounded-corners5 c-large">
Add pictures
<input type="file" name="file" multiple="">
</div>
I have tried using raw JavaScript to click on the object or selecting the element by ID, but it doesn't seem to be effective.
Even sending an enter key when the element is highlighted hasn't worked so far.
If anyone has any ideas or solutions, I would greatly appreciate them.
Please note that all keys sent should be directed to the Selenium WebDriver rather than executed by the Windows system, as the user will be interacting with a WinForm.