Currently, I am trying to create a test for file uploading using Fluentlenium and DropZone.js (). Dropzone.js operates within a modal where users can drag and drop files or upload them traditionally.
However, the test crashes as soon as the upload button is clicked because it navigates away from the browser environment.
While there are resources online explaining how to accomplish this with Selenium by targeting an input type="file" element with sendKeys, DropZone.js does not provide such element explicitly.
All the input elements visible in the DOM seem to be of type hidden:
<input type="hidden" name="key" value="temp/${filename}">
<input type="hidden" name="AWSAccessKeyId" value="secret">
<input type="hidden" name="acl" value="private">
<input type="hidden" name="success_action_redirect" value="">
<input type="hidden" name="policy" value="secret=">
<input type="hidden" name="signature" value="secret">
<input type="hidden" name="Content-Type" value="application">
In addition, our file uploads are facilitated through Amazon Web Server via the following script:
<script id="hiddenKeyPairs" type="text/javascript">
var hiddenKeyPairs = {
key: 'temp/${filename}',
AWSAccessKeyId: 'secret',
acl: 'private',
"success_action_redirect": '',
policy: 'secret',
signature: 'secret/secret',
"Content-Type": 'application'
};
var formAction = 'https://secret.com/';
</script>
I have been unable to find any information relevant to this issue on https://github.com/FluentLenium/FluentLenium#driver.
Is there a way to pass the file to the key hash mentioned in the script above? Any insights would be greatly appreciated.