Skip to content

Commit

Permalink
Implementing augmentation of previousely augmented instances
Browse files Browse the repository at this point in the history
  • Loading branch information
barancev committed Feb 13, 2014
1 parent 12e972a commit 25e8fdf
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions java/client/src/org/openqa/selenium/remote/Augmenter.java
Original file line number Diff line number Diff line change
@@ -62,10 +62,14 @@ protected <X> X create(RemoteWebDriver driver,

@Override
protected RemoteWebDriver extractRemoteWebDriver(WebDriver driver) {
if (driver.getClass() == RemoteWebDriver.class) {
if (driver.getClass() == RemoteWebDriver.class
|| driver.getClass().getName().startsWith("org.openqa.selenium.remote.RemoteWebDriver$$EnhancerByCGLIB"))
{
return (RemoteWebDriver) driver;

} else {
logger.warning("Augmenter should be applied to RemoteWebDriver instances only");
logger.warning("Augmenter should be applied to RemoteWebDriver instances " +
"or previously augmented instances only");
return null;
}
}

0 comments on commit 25e8fdf

Please sign in to comment.