Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

I am currently using Selenium 3.14.0 library in which org.openqa.selenium.remote.internal.ApacheHttpClient is deprecated with no other information. 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());
like image 931
AndiCover Avatar asked Feb 27 '19 15:02

AndiCover


People also ask

Which of the following components are deprecated in selenium?

Selenium RC (officially deprecated by selenium)allows testers to write automated web application UI test in any of the supported programming languages.

Is implicit wait deprecated?

implicitlyWait. Deprecated. Use implicitlyWait(Duration) Specifies the amount of time the driver should wait when searching for an element if it is not immediately present.


1 Answers

The HTTP client was switched to okhttp: http://square.github.io/okhttp/

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

like image 170
Corey Goldberg Avatar answered Sep 28 '22 04:09

Corey Goldberg