Question: I am running chromedriver on windows server 2016 with IIS, i have my test project installed and invoking it with an MVC5 API. That all seems fine but chromedriver and chrome.exe only seems to open as a background processes.

The same code opens these fine locally, i am not using any of the driver flags for headless browsing either. if i return the drive page source i can see that chromedriver went to google and returned the correct html in my API.

It just does not work for normal / non headless tests with google or our application.

```
        var driver = x.StartWebDriver();
        driver.Manage().Window.Maximize();
        driver.Navigate().GoToUrl("http://www.google.com");

        return driver.PageSource;

```

Any ideas?

Answer: 
As Outer.class is not instantiated by Spring container but by `new`, it cannot be known by Spring container. This is why, Spring cannot perform dependency injection for `NewService`.

Now, if you give instantiation of `Outer` to Spring, in addition to autowiring `NewService`, you are required to Autowire or use any spring wiring to wire `OldService` into `Outer`.
You can use field level injection:

```
public class Outer{
  @Autowired
  private NewService newService; 
  public Outer(OldService oldService) { this.oldService = oldService;}
}

```

I'm not a fan of this method, because it makes testing much more cumbersome and hides dependencies.

Instead of this, just use a setter and annotate it with `Autowired`, which does the same thing:

```
public class Outer{
  private NewService newService; 
  public Outer(OldService oldService) { this.oldService = oldService;}

  @Autowired
  public setNewService(NewService newService){
    this.newService = newService;
  }
}

```