Skip to content

Commit

Permalink
Call remove method
Browse files Browse the repository at this point in the history
  • Loading branch information
burakkaygusuz committed Nov 11, 2024
1 parent 498b124 commit 80c8f71
Showing 1 changed file with 8 additions and 4 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -63,9 +63,13 @@ public WebDriverBuilder enableHeadless() {
}

public WebDriver build() {
DRIVER_THREAD_LOCAL.set(url != null ? new RemoteWebDriver(url, options, isTracingEnabled)
: new RemoteWebDriver(options, isTracingEnabled));
WebDriver original = DRIVER_THREAD_LOCAL.get();
return new EventFiringDecorator<>(new CustomWebDriverListener()).decorate(original);
try {
DRIVER_THREAD_LOCAL.set(url != null ? new RemoteWebDriver(url, options, isTracingEnabled)
: new RemoteWebDriver(options, isTracingEnabled));
WebDriver original = DRIVER_THREAD_LOCAL.get();
return new EventFiringDecorator<>(new CustomWebDriverListener()).decorate(original);
} finally {
DRIVER_THREAD_LOCAL.remove();
}
}
}

0 comments on commit 80c8f71

Please sign in to comment.