SeleniumFixture icon indicating copy to clipboard operation
SeleniumFixture copied to clipboard

ChromeDriverAttribute time out

Open pbolduc opened this issue 7 years ago • 6 comments

I have a long running test which times out after 60 seconds with this error:

The HTTP request to the remote WebDriver server for URL http://localhost:16051/session/65a753f16ca91b2035f4564f44781fb4/execute timed out after 60 seconds.

The ChromeDriver class supports a commandTimeout parameter. Adding an extra overload on ChromeDriverAttribute that supports specifying a time out would solve the problem.

 public ChromeDriver(string chromeDriverDirectory, ChromeOptions options, TimeSpan commandTimeout)

TimeSpan is not a valid parameter in an attribute, so I would suggest an integer representing the number of seconds. For example,

[ChromeDriver(commandTimeout=300)]

I can supply a pull request.

pbolduc avatar Nov 07 '17 18:11 pbolduc

I'd definitely be up for a PR.

ipjohnson avatar Nov 07 '17 18:11 ipjohnson

To keep driver parity, I will extend this issue to the other drivers. Will just take a bit more testing on my part.

pbolduc avatar Nov 07 '17 19:11 pbolduc

Moving forward I'm going to upgrade the projects to selenium 3.7, are you interested in moving up to 3.7 or is it more useful for you to release against the 2.X series?

This move would include retargeting to .netstandard 2.0 and .net 4.5

ipjohnson avatar Nov 09 '17 18:11 ipjohnson

I did have an issue when I opened the solution. It wanted to upgrade the dnx project. When I committed my initial changes, I avoided committing the changes to the unrelated files.

I think it is good idea to update to the latest selenium version. We should keep that as a separate issue.

pbolduc avatar Nov 09 '17 21:11 pbolduc

I just pushed a commit on my fork related to being able to specify a command timeout when using the WebDriverAttribute types. Originally, I added overload on the browser specific attributes, ie ChromeDriverAttribute, however, if you are adding a timeout you probably want it applied to every browser.

I have added WebDriverCommandTimeoutAttribute and check for that inside browser specific attributes. For now, my change only is implemented for Chrome. This would also allow a custom driver provider to also look for the timeout attribute and configure the driver command timeout.

Looking for feedback. If it looks good, I will go through the other driver attributes and implement the changes.

pbolduc avatar Nov 12 '17 04:11 pbolduc

I agree WebDriverCommandTimeoutAttribute is the right way to go. It looks good.

ipjohnson avatar Nov 12 '17 13:11 ipjohnson