How to upload a resume to a website using selenium in python

0 votes

Below is the html which is having a “upload a resume” button on a website. I logged in to this website but now wanted to upload a resume using python selenium.

<a href="/resumes/new">upload a resume</a>

Below is the code I tried for clicking the upload a resume button. But it is throwing an error

NoSuchElementException: Message: Unable to locate element: //a[@href="/resumes/new"]

Attach_resume = browser.find_element_by_xpath('//a[@href="/resumes/new"]')

Is there anything that I am missing? I want to click that button and I want to upload a file to it. Please help me out.

Apr 20, 2018 in Selenium by Martin
• 4,340 points

1 answer to this question.

0 votes

Use this code, this will help you:

from selenium import webdriver

from import By

from import WebDriverWait

from import expected_conditions as EC

driver = webdriver.Chrome()


WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.XPATH, '//a[@href="/resumes/new"]'))).click()

WebDriverWait(driver, 10).until(EC.element_to_be_clickable((By.ID, 'resumeOnComp'))).click()

answered Apr 20, 2018 by Vardy
• 2,360 points

Related Questions In Selenium

0 votes
1 answer
0 votes
1 answer

How to measure page load time of a website using Selenium-Python?

Hello Damodar, following test script allows you ...READ MORE

answered Jul 22, 2019 in Selenium by Anvi
• 14,150 points
0 votes
1 answer
0 votes
2 answers

Finding WebDriver element with Class Name in java

The better way to handle this element ...READ MORE

answered Apr 10, 2018 in Selenium by nsv999
• 5,500 points
0 votes
2 answers

Problem while using InternetExplorerDriver in Selenium WebDriver

enable trusted connection  in internet explorer by ...READ MORE

answered Aug 31, 2020 in Selenium by Sri
• 3,190 points
0 votes
1 answer

Geo-location microphone camera pop up

To Allow or Block the notification, access using Selenium and you have to ...READ MORE

answered May 11, 2018 in Selenium by Samarpit
• 5,890 points
0 votes
2 answers

How to use such xpath to find web elements

xpath are two types. 1) Absolute XPath:    /html/b ...READ MORE

answered Sep 2, 2020 in Selenium by Sri
• 3,190 points
+11 votes
17 answers

How to automate gmail login process using selenium webdriver in java?

Check the below code: Here is the working ...READ MORE

answered Apr 24, 2018 in Selenium by Vardy
• 2,360 points
0 votes
1 answer

Select an item from a dropdown list using Selenium WebDriver

Use this then it will work - new ...READ MORE

answered Apr 9, 2018 in Selenium by Vardy
• 2,360 points