Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Override default Selenium http timeouts for RemoteWebDriver #1673

Closed
wants to merge 1 commit into from
Closed

Override default Selenium http timeouts for RemoteWebDriver #1673

wants to merge 1 commit into from

Conversation

IrinaStyazhkina
Copy link

Earlier in pr #1433 default Selenium http timeouts were overriden.

But it didn't work for RemoteWebDriver

Now we also set shorter timeouts (connectTimeout = 1 minute, readTimeout = 2 minutes) for remote.

@BorisOsipov
Copy link
Member

Not sure that is the best solution. It seems you can use RemoteWebDriver contructor to set custom timeouts in https://github.com/selenide/selenide/blob/master/src/main/java/com/codeborne/selenide/webdriver/RemoteDriverFactory.java#L15 by smth like that -

        ClientConfig clientConfig = ClientConfig
                .defaultConfig()
                .baseUrl(url)
                .readTimeout(Duration.ofMinutes(1))
                .connectionTimeout(Duration.ofMinutes(2));

        Tracer tracer = OpenTelemetryTracer.getInstance();

        CommandExecutor httpCommandExecutor = new HttpCommandExecutor(
                Collections.emptyMap(),
                clientConfig,
                new TracedHttpClient.Factory(tracer, HttpClient.Factory.createDefault()));
        TracedCommandExecutor tracedCommandExecutor = new TracedCommandExecutor(httpCommandExecutor, tracer);
        RemoteWebDriver wd = new RemoteWebDriver(tracedCommandExecutor, capabilities);

@asolntsev
Copy link
Member

@IrinaStyazhkina I agree: setting timeouts in constructor of RemoteDriverFactory seems to be better than using reflection. What do you think?

@asolntsev
Copy link
Member

@IrinaStyazhkina ^^ ping ^^

@asolntsev
Copy link
Member

I create pull request #1703 with the implementation mentioned above.

@asolntsev
Copy link
Member

Superseded by #1703 and released as Selenide 6.2.1

@asolntsev asolntsev closed this Jan 22, 2022
@asolntsev asolntsev added this to the 6.2.1 milestone Jan 22, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants