The place I am trying to upload an image to is
http://www.marktplaats.nl/The page has a custom file upload widget that looks like this:
Once clicked, the browser displays a file chooser, and once a file is chosen, the upload automatically starts and you end up with this:
I tried accessing the underlying input element that looks like this:
<form id="syi-form" method="post" action="
https://www.marktplaats.nl/syi/plaatsAdvertentie.html/m/save.html" novalidate="">
//a lot of stuff ommited
<input id="html5_1au5jf4tj1f7p13q8vko1hr511jlh" style="font-size: 999px; opacity: 0; position: absolute; top: 0px; left: 0px; width: 100%; height: 100%;" multiple="" accept="image/jpeg,image/bmp,image/png" type="file">
//a lot of stuff ommited
</form>
by doing this:
var uplContainer0 = x("//input[contains(@accept, 'imasge/jpeg')]");
...
.waitForSelector(uplContainer0)
.then(function(){
casper.page.uploadFile(uplContainer0,'imsg.png' );
})
But my code fails silently, no error is shown, and no image is uploaded.
Can anyone help me?