My company's website features a unique image upload button that differs from the traditional input type file. I'm looking for an automated way to upload images using this button without relying on tools like AutoIt to interact with the file explorer.
Here is a snippet of the HTML code for this particular button:
<button ng-click="onClick()" ng-disabled="readOnly" accepted-types="image/*" on-files-selected="onFilesSelected" allow-multiple="true" readonly="readonly">Add images</button>
Since this button does not use the standard input element, such as <input type="file">
, and instead utilizes AngularJS, I am unable to use Selenium's sendKeys() function to input the image file location from my machine.
I am exploring possible hacks or workarounds for uploading the image, such as overriding the onClick() function to read from a specified location (although this approach seems impractical), or intercepting the event that triggers the file explorer opening in order to find a solution. However, these methods are experimental and unsupported.
I am curious if utilizing another browser automation tool, such as Microsoft's Playwright, could provide a solution to this challenge.