Answer the question
In order to leave comments, you need to log in
How to pass image through file select window in Selenium?
The page has the following image submission form:
<ol class="bp" id="u_0_0">
<li class="bq"><input type="file" name="pic"></li>
<li>
<input value="Save" type="submit" class="br bs bt bu bv">
</li>
</ol>
driver.find_element(By.XPATH, '//input[@type="file"][@name]').send_keys(img)
selenium.common.exceptions.InvalidArgumentException: Message: invalid argument: File not found : /libs/img/42.jpg
Answer the question
In order to leave comments, you need to log in
Try, first, to specify the full path (from the root) to the
/libs/img/42.jpg file - is the libs folder in the root of the file system?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question