title: ChromeDriver not working for Angular application - Selenium Automation
body: <p>I'm working on automating an Angular application. Scripts which I have implemented perfectly works for Microsoft Edge browser. But when same scripts I am running for Chrome browser after instantiating the ChromeDriver in my code Its starts giving null pointer exception.
  However , code launches the application but when it comes to <code>driver.getTitle()</code>, its starts giving null pointer exception.</p>
  <p>Chrome Version :- 103</p>
  <p>Selenium Version :- 4.0.0-alpha-5</p>
  <p>Code :-</p>
  <pre><code>System.out.println(&quot;Running in Chrome&quot;);
  System.setProperty(&quot;webdriver.chrome.driver&quot;, &quot;Drivers&quot; + File.separator + &quot;chromedriver.exe&quot;);
  ChromeOptions Ioptions = new ChromeOptions();
  Ioptions.addArguments(&quot;--start-maximized&quot;);
  WebDriver driver = new ChromeDriver(Ioptions);
  driver.get(app_url);
  driver.getTitle();
  </code></pre>
  <p>Exception :-</p>
  <p>java.lang.NullPointerException
  at com.optum.taskTracker.ui.stepDefinitions.Hooks.takescreenshot(Hooks.java:269)
  at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
  at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
  at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
  at java.lang.reflect.Method.invoke(Method.java:498)
  at cucumber.runtime.Utils$1.call(Utils.java:37)
  at cucumber.runtime.Timeout.timeout(Timeout.java:13)
  at cucumber.runtime.Utils.invoke(Utils.java:31)
  at cucumber.runtime.java.JavaHookDefinition.execute(JavaHookDefinition.java:60)
  at cucumber.runtime.Runtime.runHookIfTagsMatch(Runtime.java:223)
  at cucumber.runtime.Runtime.runHooks(Runtime.java:211)
  at cucumber.runtime.Runtime.runAfterHooks(Runtime.java:205)
  at cucumber.runtime.model.CucumberScenario.run(CucumberScenario.java:46)
  at cucumber.runtime.junit.ExecutionUnitRunner.run(ExecutionUnitRunner.java:91)
  at org.junit.runners.Suite.runChild(Suite.java:128)
  at org.junit.runners.Suite.runChild(Suite.java:27)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
  at cucumber.runtime.junit.ExamplesRunner.run(ExamplesRunner.java:59)
  at org.junit.runners.Suite.runChild(Suite.java:128)
  at org.junit.runners.Suite.runChild(Suite.java:27)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
  at cucumber.runtime.junit.ScenarioOutlineRunner.run(ScenarioOutlineRunner.java:53)
  at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:63)
  at cucumber.runtime.junit.FeatureRunner.runChild(FeatureRunner.java:18)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
  at cucumber.runtime.junit.FeatureRunner.run(FeatureRunner.java:70)
  at cucumber.api.junit.Cucumber.runChild(Cucumber.java:93)
  at cucumber.api.junit.Cucumber.runChild(Cucumber.java:37)
  at org.junit.runners.ParentRunner$3.run(ParentRunner.java:290)
  at org.junit.runners.ParentRunner$1.schedule(ParentRunner.java:71)
  at org.junit.runners.ParentRunner.runChildren(ParentRunner.java:288)
  at org.junit.runners.ParentRunner.access$000(ParentRunner.java:58)
  at org.junit.runners.ParentRunner$2.evaluate(ParentRunner.java:268)
  at org.junit.runners.ParentRunner.run(ParentRunner.java:363)
  at cucumber.api.junit.Cucumber.run(Cucumber.java:98)
  at org.eclipse.jdt.internal.junit4.runner.JUnit4TestReference.run(JUnit4TestReference.java:89)
  at org.eclipse.jdt.internal.junit.runner.TestExecution.run(TestExecution.java:40)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:541)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.runTests(RemoteTestRunner.java:768)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.run(RemoteTestRunner.java:464)
  at org.eclipse.jdt.internal.junit.runner.RemoteTestRunner.main(RemoteTestRunner.java:210)</p>