Skip to content

Conversation

@tteguayco
Copy link
Contributor

A chromedriver.exe that matches the version of the installed Google Chrome browser on the user's machine can be now automatically downloaded.

This Pull Request contains an addition to the README that shows how this new feature can be used.

Tested "on the fly", as I couldn't think of a unit test that makes sense (it depends on the machine which the project runs on).

Issue requesting feature: #85

@Piedone
Copy link

Piedone commented Sep 1, 2020

Looks great, thank you! I'll check this out this week.

Comment on lines 76 to 87
using (var response = webRequest.GetResponse())
{
using (var content = response.GetResponseStream())
{
if (content == null) throw new ArgumentNullException($"Can't get content from URL: {uri}");
using (var reader = new StreamReader(content))
{
var version = reader.ReadToEnd().Trim();
return version;
}
}
}
Copy link

@Piedone Piedone Sep 5, 2020

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can merge these usings (omit the brackets of the first one) or if OK in this project also use the new using var notation. The same in GetLatestVersion().

Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

In my opinion current implementation is pretty simple and obvious

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I'll let you guys decide this issue. I grabbed already existing code to implement this part.


public virtual string GetMatchingBrowserInstalledVersion()
{
throw new NotImplementedException();
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hmm, I awaited this to be thrown when using FF with version: "matching_installed" but it didn't. What could be the issue?

@rosolko
Copy link
Owner

rosolko commented Sep 10, 2020

@tteguayco @Piedone I've updated code a little bit, can you please review it?

@tteguayco
Copy link
Contributor Author

@tteguayco @Piedone I've updated code a little bit, can you please review it?

Looks great to me, @rosolko. Your naming convention is much better and clear.

Could you check what @Piedone says about the exception ```NotImplementedException```` not being thrown when using a browser that does not support this new feature?

@Piedone
Copy link

Piedone commented Sep 10, 2020

Looks great! I've also tested it and works as it should. I now also get the exception for Firefox.

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.

3 participants