Skip to content

Commit

Permalink
Update WebDriverManager Server to work with docker-selenium
Browse files Browse the repository at this point in the history
  • Loading branch information
bonigarcia committed Feb 27, 2025
1 parent cc6dcbc commit deae063
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 3 additions & 1 deletion src/main/java/io/github/bonigarcia/wdm/WdmServer.java
Original file line number Diff line number Diff line change
Expand Up @@ -164,6 +164,7 @@ private void seleniumServer(Context ctx) throws IOException {
.browserVersion(version);
wdm.create();
seleniumServerUrl = wdm.getDockerSeleniumServerUrl();
wdm.getWebDriver().quit();
} else {
String sessionIdFromPath = getSessionIdFromPath(requestPath);
seleniumServerUrl = sessionMap.get(sessionIdFromPath);
Expand Down Expand Up @@ -197,7 +198,7 @@ private void seleniumServer(Context ctx) throws IOException {
private String getSessionIdFromResponse(String response) {
response = response.substring(
response.indexOf(SESSIONID) + SESSIONID.length() + 1);
response = response.substring(0, response.indexOf("\""));
response = response.substring(1, response.indexOf(",") - 1);
return response;
}

Expand Down Expand Up @@ -279,6 +280,7 @@ public String exchange(String url, String method, String json,
String responseContent = null;
BasicHttpClientConnectionManager connectionManager = new BasicHttpClientConnectionManager();
connectionManager.setConnectionConfig(ConnectionConfig.custom()
.setSocketTimeout(timeoutSec, TimeUnit.SECONDS)
.setConnectTimeout(timeoutSec, TimeUnit.SECONDS).build());

try (CloseableHttpClient closeableHttpClient = HttpClientBuilder
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,6 @@
import java.util.stream.Stream;

import org.junit.jupiter.api.BeforeAll;
import org.junit.jupiter.api.Disabled;
import org.junit.jupiter.api.condition.EnabledOnOs;
import org.junit.jupiter.params.ParameterizedTest;
import org.junit.jupiter.params.provider.Arguments;
Expand All @@ -51,7 +50,6 @@
* @since 5.0.0
*/
@EnabledOnOs(LINUX)
@Disabled
class ServerSeleniumTest {

static final Logger log = getLogger(lookup().lookupClass());
Expand Down

0 comments on commit deae063

Please sign in to comment.