I want 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 the normal:
selenium = new WebDriverBackedSelenium(driver, "http://www.dunnowhattodo.org");
...but it doesn't work (I get the error "unknown protocol: c").
We can perform Selenium testing without a browser. This is achieved by triggering the execution in a headless mode. The headless execution can decrease the utilization of key resources and is being adopted widely.
Try using this method:
webdriver.get("file:///D:/folder/abcd.html");
(or)
selenium = new WebDriverBackedSelenium(driver, "file:///D:/folder/abcd.html");
This can also be done with a relative file:
Path sampleFile = Paths.get("sample.html"); driver.get(sampleFile.toUri().toString());
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