Issue
It seems like for Chrome and Edge, I can simply match my browser but is there a way to do the same with Firefox? I see from the documentation here, it only works for Chrome (which isn't true since it works for Edge). I don't have control of updating the browsers so if the case arises, how can I automatically download the correct driver version? I don't want to manually handle this process. Below is the issue for Firefox.
public void DownloadDrivers(EDriver driver)
{
if(driver == EDriver.Edge)
{
_ = new DriverManager().SetUpDriver(new EdgeConfig(), VersionResolveStrategy.MatchingBrowser);
}
else if(driver == EDriver.Firefox)
{
// VersionResolveStrategy.MatchingBrowser is equal to "MatchingBrowser"
// If I don't pass it in, it will take the default value of "Latest"
_ = new DriverManager().SetUpDriver(new FirefoxConfig(), VersionResolveStrategy.MatchingBrowser);
}
else if(driver == EDriver.Chrome)
{
_ = new DriverManager().SetUpDriver(new ChromeConfig(), VersionResolveStrategy.MatchingBrowser);
}
}
Solution
It seems like this is actually a bug that has been raised as an issue in the GitHub repo
The issue seems to be that for edge and Chrome, the driver version and major version of the browser match (as in major version 105 of the browser will be version 105 of the driver).
The same isn't for Firefox (major version 104 of the Firefox browser will be 0.31 of the driver)
https://github.com/rosolko/WebDriverManager.Net/issues/189
Answered By - ThisIsMyAlias
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.