I am trying to upload a jpg file on website using selenium and python.
I happened to find a way to do so and succeeded on a practice website. (http://demo.guru99.com/test/upload/)
but when I tried my real target website, the method did not work.
This is the elements of the website regarding file uploading.
<span class="reg_btn_full"><input type="file" name="btnSelectFile" class="reg_file" cmd="reg"></span>
<input type="file" name="btnSelectFile" class="reg_file" cmd="reg">
I couldn't find ID in the elements so I used X path.
This is my code.
driver.find_element_by_xpath("the x path").send_keys("D:/1.jpg")
and the error code was like this.
Exception has occurred: InvalidArgumentException
Message: File not found: D:/1.jpg
Do you think it has something to do with form element?
If you think so, please tell me what to do.