Home > Back-end >  Chromedriver c# - no suitable constructor
Chromedriver c# - no suitable constructor

Time:09-17

Hello guys how can I run Chromedriver with SERVICE,OPTIONS,PATH?

I have 8 constructors available but not even one is for those 3 parameters.

Thanks for answer.

I need this ,how can I achieve it?

public ChromeDriver(string chromeDriverDirectory,ChromeDriver service, 
ChromeOptions options);

enter image description here

CodePudding user response:

There is not a constructor which takes SERVICE, OPTIONS, PATH.
The most similar to what you are looking for is this one:

public ChromeDriver(ChromeDriverService service, ChromeOptions options);;

Usage:

var chromeOptions = new ChromeOptions();

// Your configuration
// e.g. options.AddArgument("--disable-popup-blocking");

var driver = new ChromeDriver(ChromeDriverService.CreateDefaultService("PATH"), chromeOptions);
  • Related