在Selenium中绑定IP

时间:2017-02-13 20:34:18

标签: c# selenium selenium-chromedriver remotewebdriver webautomation

我有4台设备连接到同一台PC上的4个不同的物理接口(192.168.1.2到192.168.1.5)。它们都具有相同的IP地址(例如192.168.1.1)。我想将本地IP地址绑定到Selenium,以便我知道我正在打开哪个设备的网页。我尝试使用RemoteWebDriver:

'DesiredCapabilities dc = DesiredCapabilities.Chrome();

 IWebDriver driver = new RemoteWebDriver(new Uri("http://192.168.1.2:4444"), dc);
 driver.Navigate().GoToUrl("http://192.168.1.1");'

但是,我一直收到以下错误:

错误403禁止代理

如果我将“/ wd / hub”添加到Uri,驱动程序将侦听127.0.0.1,我将不知道哪个设备网页是打开的。

这个问题有解决方法吗?

感谢。

0 个答案:

没有答案