malformed url java selenium while using local picture -


so i'm trying upload image using selenium can test functionality of website. have tried various things , have been unable image upload.

i've tried attachfile:

selenium.attachfile("id=upload_field", "c:\\bacon.jpg"); 

i've tried using driver in below code find element:

webelement uploadimage = driver.findelement(by.xpath("//input[@type='file']")); uploadimage.sendkeys("c:\\bacon.jpg") 

i've tried find element button id:

webelement uploadimage = driver.findelement(by.id("upload_button")); 

i've tried using click , upload method errors out when use click , tells me should using attachfile. the website uses modal window upload story.

any appreciated.

oh, when use attachfile error:

com.thoughtworks.selenium.seleniumexception: malformed url:c:\bacon.jpg


Comments

Popular posts from this blog

html - Outlook 2010 Anchor (url/address/link) -

javascript - Why does running this loop 9 times take 100x longer than running it 8 times? -

Getting gateway time-out Rails app with Nginx + Puma running on Digital Ocean -