java - How to inject a path into a type="file" field using JavaScript -


i'm having problem sending path file type="file" field (file upload scenario) handles bit weird.

i'm using webdriver java , not wish use 3rd party tools such autoit.

please note trying element.sendkeys not work, field default opens os browse-to-file type window cannot handled webdriver.

you can see below how looks like:

<input type="file" size="40" name="filename"> 

this not expand further , represents field + browse button!

the solution found out how work above scenario (without sendkeys , autoit) javascript injection, have no idea how that.

thanks,

vivian

thanks comments guys!

the solution, sendkeys indeed, after generating retarded xpath in human history firepath.

be careful, previous attempts didn't work xpath used before "//input...", though valid, sending keys browse button, xpath-wise same element field (what sorcery this?).

so yeah, has problems file upload forms via webdriver - retarded xpath , element.sendkeys.

cheers!


Comments

Popular posts from this blog

Delphi XE2 Indy10 udp client-server interchange using SendBuffer-ReceiveBuffer -

Qt ActiveX WMI QAxBase::dynamicCallHelper: ItemIndex(int): No such property in -

Enable autocomplete or intellisense in Atom editor for PHP -