Skip to content

Commit

Permalink
Avoid looking up the driver provider more than once.
Browse files Browse the repository at this point in the history
  • Loading branch information
shs96c committed Mar 13, 2017
1 parent 557a114 commit a9f8869
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ DriverProvider getProviderMatching(Capabilities desired) {
public WebDriver newInstance(Capabilities capabilities) {
DriverProvider provider = getProviderMatching(capabilities);
if (provider.canCreateDriverInstanceFor(capabilities)) {
return getProviderMatching(capabilities).newInstance(capabilities);
return provider.newInstance(capabilities);
}
throw new WebDriverException(String.format(
"The best matching driver provider %s can't create a new driver instance for %s",
Expand Down

0 comments on commit a9f8869

Please sign in to comment.