0

I am using latest version bonigarcia/webdrivermanager. In my company they are not allowing to access the driver api website for downloading driver exe or api while using company VPN, even proxy does not work.

How I can resolve this issue? What option provided by webdrivermanager to overcome this situation?

Note- Framework is required to run while VPN is on.

Shrirang
  • 1
  • 1

1 Answers1

0

In your scenario you need the company proxy. Once you get it you need to follow these steps when using MAVEN:

Under .m2 folder, create an xml file called settings and enter the proxy below

<settings>
  <proxies>
   <proxy>
      <active>true</active>
      <protocol>https</protocol>
      <host>YOUR COMPANY PROXY</host>
      <port>80</port>
      <username></username>
      <password></password>
      <nonProxyHosts></nonProxyHosts>
    </proxy>
  </proxies>
</settings>

Enter the following in the main project so that webdrivermanager can work:

WebDriverManager.chromedriver().proxy("YOUR COMPANY PROXY:80").setup();
WebDriver driver = new ChromeDriver();

That will make it work.

Learner
  • 123
  • 1
  • 13
  • I am using WebDriverManager.chromedriver().browserVersion(browserVersion).create() method. I am not using this way-> WebDriverManager.chromedriver().proxy("YOUR COMPANY PROXY:80").setup(); WebDriver driver = new ChromeDriver(); Also, I have used this method of proxy but did not help. – Shrirang Sep 30 '21 at 03:40
  • Did you enter your company proxy in the settings XML file and add it also when declaring your webdrivermanager (WebDriverManager.chromedriver().proxy("YOUR COMPANY PROXY:80").setup();). Make sure there's consistency between what you enter in the settings xml file and what you add in your java code. – Learner Sep 30 '21 at 03:51
  • Sorry, I would like rephrase my question again, company default provide proxy to access other site but for project purpose we have to use VPN, in which they do not allow anything except their own few sites. Also my one doubt also, what is connection between .m2/setting file and webdrivermanager for downloading driver exe. – Shrirang Sep 30 '21 at 04:10