How do you set the port for ChromeDriver in Selenium?

后端 未结 1 424
无人及你
无人及你 2020-12-20 01:56

As some background, I\'m playing around with BrowserMob proxy and I am getting blocked by the port settings. So I\'d like to know how to set a port by myself.



        
相关标签:
1条回答
  • 2020-12-20 02:56

    This should work:

    ChromeDriverService service= ChromeDriverService.CreateDefaultService(DRIVER_PATH);
    service.Port = <PORT>;
    IWebDriver WebDriver = new ChromeDriver(service);
    
    0 讨论(0)
提交回复
热议问题