0

I'm trying to upload photo without the windows popup. So i was trying to use driver.find_element_by_id("IdOfInputTypeFile").send_keys("/image.png") . The problem is i can't find input element, here the screen shots of the html code and also i've found 2 hidden inputs i don't know what's for. Thank you! (Screenshot1) (Screenshot2) - (Screenshot3) - (Screenshot4) - (Screenshot5) - (Screenshot6) - (Screenshot7) - (The 2 hidden inputs)

  • Seems to be the file upload form does not have `input type of file`. You can try `//input[@type='file']` xpath in the [dev tools](https://stackoverflow.com/questions/55870609/is-there-a-way-to-learn-xpath-without-using-firebug-or-xpath-as-firefox-is-not-s/55870909#55870909) to see if there is any fileupload input filed exist on the page. – supputuri Apr 04 '20 at 15:42
  • So there is no input filed on the page. The other approach would be using API to upload the file. – supputuri Apr 04 '20 at 18:31
  • @supputuri i searched for it and found it ! Thank you ! – mouad seghini Apr 04 '20 at 18:40
  • You mean the `//input[@type='file']` worked? – supputuri Apr 04 '20 at 19:24
  • @supputuri Yes! i just didn't know how to use it well in the first try. Now it's worked. Thank you so much ! – mouad seghini Apr 04 '20 at 19:35

1 Answers1

0

try //input[@type='file'] xpath in the dev tools to see if there is any fileupload input filed exist on the page

//input[@type='file']
supputuri
  • 13,644
  • 2
  • 21
  • 39
  • If you feel the issue is resolved, please [accept](https://meta.stackexchange.com/questions/5234/how-does-accepting-an-answer-work) if this/any answer is/was helpful to you. Also [Upvote](https://stackoverflow.com/help/why-vote) the answer for the benefit of the future readers – supputuri Apr 04 '20 at 19:40