Skip to content

Commit

Permalink
Remove hard-coded port from test
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Sep 28, 2021
1 parent fd5af83 commit 8d0eb03
Showing 1 changed file with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
import org.openqa.selenium.grid.testing.TestSessionFactory;
import org.openqa.selenium.grid.web.CombinedHandler;
import org.openqa.selenium.grid.web.EnsureSpecCompliantHeaders;
import org.openqa.selenium.net.PortProber;
import org.openqa.selenium.netty.server.NettyServer;
import org.openqa.selenium.remote.http.Contents;
import org.openqa.selenium.remote.http.HttpClient;
Expand Down Expand Up @@ -165,7 +166,8 @@ public void ensureJsCannotCreateANewSession() throws URISyntaxException {
@Test
public void shouldNotRetryNewSessionRequestOnUnexpectedError() throws URISyntaxException {
Capabilities capabilities = new ImmutableCapabilities("browserName", "cheese");
URI nodeUri = new URI("http://localhost:4444");
int nodePort = PortProber.findFreePort();
URI nodeUri = new URI("http://localhost:" + nodePort);
CombinedHandler handler = new CombinedHandler();

SessionMap sessions = new LocalSessionMap(tracer, events);
Expand Down Expand Up @@ -241,7 +243,8 @@ public void shouldNotRetryNewSessionRequestOnUnexpectedError() throws URISyntaxE
@Test(timeout = 10000L)
public void shouldRejectRequestForUnsupportedCaps() throws URISyntaxException {
Capabilities capabilities = new ImmutableCapabilities("browserName", "cheese");
URI nodeUri = new URI("http://localhost:4444");
int nodePort = PortProber.findFreePort();
URI nodeUri = new URI("http://localhost:" + nodePort);
CombinedHandler handler = new CombinedHandler();

SessionMap sessions = new LocalSessionMap(tracer, events);
Expand Down

0 comments on commit 8d0eb03

Please sign in to comment.