In my projects ScenarioSetup.java I am setting a few options via ChromeOptions and one of them is to open up the browser in incognito;
options.addArguments("--incognito");
Now I wanted to know if its possible to check ChromeOptions for within another class. Someone suggested to do the following, however it just throws a null pointer.
if (System.getProperty("chromeoptions.args").equals("--incognito")) {
do something;
} else {
do something else;
}