So I am trying to write a test in which the first step is logging in, but it is denying me access as it detected automation tools because the javascript has not been enabled and there is no profile. So I am trying to load my default profile. The problem I’m getting is that the browser does open, but it quickly fails as I get a SessionNotCreatedException. The failure occurs in the service hooks:
@Before(“@FrontendTest”)
public void setup() {
System.setProperty(“webdriver.chrome.driver”,
“E:\interview_notcodegod\src\drivers\chromedriver.exe” );
ChromeOptions options = new ChromeOptions();
options.addArguments(“–enable-javascript”);
options.addArguments(“–user-data-dir=C:/Users/[username]/AppData/Local/Google/Chrome/User Data”);
WebDriverManager.chromedriver().setup();
driver = new ChromeDriver(options); // intellij points here (nullpointerexception)
driver.manage().window().maximize();
}
Is there a line of code that i’m missing? I’ve updated my chromedriver already because I thought that was the issue (chrome Version 99.0.4844.74 (Official Build) (64-bit), chromedriver:99.0.4844.51)
Source: Read More