How to use Selenium WebDriver on local webpage (on my PC) instead of one located somewhere online?

前端 未结 6 2004
小鲜肉
小鲜肉 2020-11-27 18:58

I want to use Selenium WebDriver on a webpage that I have on my hard disc. I\'ve tried to something like:

selenium =         


        
6条回答
  •  清歌不尽
    2020-11-27 19:35

    This can also be done with a relative file:

    Path sampleFile = Paths.get("sample.html");
    driver.get(sampleFile.toUri().toString());
    

提交回复
热议问题