Skip to content

feat: add setScriptTimeout method#19

Merged
paodb merged 1 commit into
mainfrom
feat-scriptTimeout
Jun 29, 2023
Merged

feat: add setScriptTimeout method#19
paodb merged 1 commit into
mainfrom
feat-scriptTimeout

Conversation

@javier-godoy

Copy link
Copy Markdown
Member

Add a new method called setScriptTimeout in order to simplify configuration of the timeout for asynchronous script execution in Selenium (which is used by RPC calls).

-getDriver().manage().timeouts().setScriptTimeout(timeoutMillis, TimeUnit.MILLISECONDS);
+setScriptTimeout(timeoutMillis);

Note that recent versions of Selenium no longer support negative values to disable the timeout. Therefore, I have implemented a workaround by using a large value instead. While the official Selenium documentation mentions support for values up to 2e16-1, I found that setting such a high value was not possible. As an alternative, I have chosen a value of 9e15, which still allows the script to execute for a considerable amount of time (a few millennia).

@javier-godoy javier-godoy requested a review from paodb June 29, 2023 18:49
@paodb paodb merged commit bdba17d into main Jun 29, 2023
@paodb paodb deleted the feat-scriptTimeout branch June 29, 2023 18:53
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants