Bartosz Wyględacz Bartosz Wyględacz - 1 month ago 7
Java Question

How to use selenium webdriver on local (on my pc) webpage instead of locate somwhere on www?

I have to use selenium webdriver on a webpage that i have on my hard disc. i've tried to something like:

selenium = new WebDriverBackedSelenium(driver, "C:\\...dispatcher.html");


instead of normal:

selenium = new WebDriverBackedSelenium(driver, "http://www.dunnowhattodo.org");


But it don't work (i get error "unknown protocol: c")

Is it even possible? im kinda new user of selenium webdriver so it can be a silly question, but still i will appriciate every help i will get:)

Answer

Try using this method:

webdriver.get("file:///D:/folder/abcd.html");

(or)

selenium = new WebDriverBackedSelenium(driver, "file:///D:/folder/abcd.html");