VladimirMikulic's solution to "Python Selenium Salesforce file upload "

Solution<\/h1>\n\n

Hi! This can be due to a number of reasons, but here is what I think:<\/p>\n\n

1) Your file upload element is probably hidden. Make it visible.
\ndriver.execute_script(&quot;document.querySelector('cssSelector').style.visibility = 'visible'&quot;)<\/code><\/p>\n\n

2) The file path needs to be absolute, not relative.
\ndriver.find_element(by=By.ID, value=&quot;uploadFile&quot;).send_keys(&quot;/absolute/path/test.csv&quot;)<\/code><\/p>\n\n

Let me know if this worked for you.<\/p>\n

# Solution Hi! This can be due to a number of reasons, but here is what I think: 1) Your file upload element is probably hidden. Make it visible. `driver.execute_script("document.querySelector('cssSelector').style.visibility = 'visible'")` `driver.execute_script("document.querySelector('cssSelector').style.display = 'block'")` 2) The file path needs to be absolute, not relative. `driver.find_element(by=By.ID, value="uploadFile").send_keys("/absolute/path/test.csv")` Let me know if this worked for you.
# Solution Hi! This can be due to a number of reasons, but here is what I think: 1) Your file upload element is probably hidden. Make it visible. `driver.execute_script("document.querySelector('cssSelector').style.visibility = 'visible'")` `driver.execute_script("document.querySelector('cssSelector').style.display = 'block'")` 2) The file path needs to be absolute, not relative. `driver.find_element(by=By.ID, value="('#uploadFile').style.visibility = 'visible'")` `driver.execute_script("document.querySelector('#uploadFile').style.display = 'block'")` 2) The file path needs to be absolute, not relative. `driver.find_element(by=By.ID, value="uploadFile").send_keys("/absolute/path/test.csv")` Let me know if this worked for you.

User: VladimirMikulic

Question: Python Selenium Salesforce file upload

Back to question