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

java - WARN : org.springframework.web.servlet.PageNotFound - No mapping found for HTTP request with URI [/board/] in DispatcherServlet with name 'appServlet' -

android - How to create dynamically Fragment pager adapter -

1111. appearing after print sequence - php -