Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
import static io.github.bonigarcia.wdm.DriverManagerType.CHROME;
import org.openqa.selenium.WebDriver;
import io.github.bonigarcia.wdm.WebDriverManager;
// ...
DriverManagerType chrome = DriverManagerType.CHROME;
Class<?> chromeClass = Class.forName(chrome.browserClass());
driver = (WebDriver) chromeClass.newInstance();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment