selenium webdriver upload file

Your code work perfectly for me (I test it with Firefox, Chrome driver) One thing I supect is excessive backslash(\) escape. Try following: driver.find_element_by_id(“start-upload-button-single”).click() driver.find_element_by_css_selector(‘input[type=”file”]’).clear() driver.find_element_by_css_selector(‘input[type=”file”]’).send_keys(“C:\\Documents and Settings\\pcname\\Desktop\\ffdlt\\test.jpeg”) or driver.find_element_by_id(“start-upload-button-single”).click() driver.find_element_by_css_selector(‘input[type=”file”]’).clear() driver.find_element_by_css_selector(‘input[type=”file”]’).send_keys(r”C:\Documents and Settings\pcname\Desktop\ffdlt\test.jpeg”)

Using upper-case and lower-case xpath functions in selenium IDE

upper-case() and lower-case() are XPath 2.0 functions. Chances are your platform supports XPath 1.0 only. Try: translate(‘some text’,’abcdefghijklmnopqrstuvwxyz’,’ABCDEFGHIJKLMNOPQRSTUVWXYZ’) which is the XPath 1.0 way to do it. Unfortunately, this requires knowledge of the alphabet the text uses. For plain English, the above probably works, but if you expect accented characters, make sure you add them … Read more

Equivalent of waitForVisible/waitForElementPresent in Selenium WebDriver tests using Java?

Implicit and Explicit Waits Implicit Wait An implicit wait is to tell WebDriver to poll the DOM for a certain amount of time when trying to find an element or elements if they are not immediately available. The default setting is 0. Once set, the implicit wait is set for the life of the WebDriver … Read more

Running Selenium Webdriver with a proxy in Python

Works for me this way (similar to @Amey and @user4642224 code, but shorter a bit): from selenium import webdriver from selenium.webdriver.common.proxy import Proxy, ProxyType prox = Proxy() prox.proxy_type = ProxyType.MANUAL prox.http_proxy = “ip_addr:port” prox.socks_proxy = “ip_addr:port” prox.ssl_proxy = “ip_addr:port” capabilities = webdriver.DesiredCapabilities.CHROME prox.add_to_capabilities(capabilities) driver = webdriver.Chrome(desired_capabilities=capabilities)