I am performing some file uploading tests. I found that my test code hangs at element.send_keys(file)
if I am using PhantomJS, however the same code does not hang if I am using Firefox.
element = self.browser.find_element_by_xpath("//input[@type='file']")
element.send_keys(file)
Is there any workarounds to make PhantomJS upload files properly? Currently I am using Windows 7, Python 3.4.1, selenium 2.42.1, PhantomJS 1.9.7.
browser = webdriver.PhantomJS()
browser.set_window_size(1200,800)
Without setting the window size, the browser remains in mobile size causing errors. Try a implicit wait too.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With