org.openqa.selenium.remote.internal.ApacheHttpClient is deprecated in selenium 3.14.0 – What should be used instead?

  • A+

I am currently using selenium 3.14.0 library in which org.openqa.selenium.remote.internal.ApacheHttpClient is deprecated with no other information. Does anyone know which should be used instead? The class is already removed in the next version 3.141.59.

I am using it with EdgeDriver Service like following:

final int connectionTimeout = 2 * 60 * 1000;         final int socketTimeout = 10 * 60 * 1000; // 10 minute timeout         final ApacheHttpClient.Factory clientFactory = new ApacheHttpClient.Factory(                 new HttpClientFactory(connectionTimeout, socketTimeout)); ... edgeDriverService = new EdgeDriverService.Builder()                         .usingDriverExecutable(edgeDriver)                         .usingAnyFreePort()                         .build(); edgeDriverService.start(); HttpCommandExecutor executor = new HttpCommandExecutor(new HashMap<>(), edgeDriverService.getUrl(), clientFactory); WebDriver driver = new RemoteWebDriver(executor, new EdgeOptions()); 


The http client was switched to okhttp:

This is mentioned in the selenium Java CHANGELOG of version 3.11.0 and also you can see it in the source code.


:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen: