Selenium File Upload Without Element
I'm trying to upload my resume using selenium/python over here , under the Resume/CV Attach part. When I inspect the Attach element, it shows up as
Solution 1:
Actually there is an input for file uploading. You can use below code:
driver.find_element_by_id('file').send_keys(info.resume)
Note that all 3 file input fields (CV, Cover letter and Unofficial copy of your transcript) have the same id
attribute "file"
, so you can select each by index:
driver.find_elements_by_id('file')[0].send_keys(info.resume)
driver.find_elements_by_id('file')[1].send_keys(info.cover_letter)
driver.find_elements_by_id('file')[2].send_keys(info.transcript)
Post a Comment for "Selenium File Upload Without Element"