PhantomJSDriverService ConfigFile Property WebDriver
Gets or sets the path to the JSON configuration file (in lieu of providing any other parameters).

Namespace: OpenQA.Selenium.PhantomJS
Assembly: WebDriver (in WebDriver.dll) Version: 2.35.0.0 (2.35.0.0)
Syntax

public string ConfigFile { get; set; }
Remarks

If a PhantomJSDriverService instance is serialized to JSON, it can be saved to a file and used as a JSON configuration source for the PhantomJS.exe process.
Examples

var configOptions = PhantomJSDriverService.CreateDefaultService()
{
    CookiesFile = "cookiesFile",
    DiskCache = true,
    IgnoreSslErrors = true,
    LoadImages = true,
    LocalToRemoteUrlAccess = true,
    MaxDiskCacheSize = 1000,
    OutputEncoding = "abc",
    Proxy = "address:999",
    ProxyType = "socks5",
    ScriptEncoding = "def",
    SslProtocol = "sslv2",
    WebSecurity = true,
};

string json = configOptions.ToJson();

File.WriteAllText(@"C:\temp\myconfig.json", json);

var driverService = PhantomJSDriver.CreateDefaultService();
driverService.ConfigFile = @"C:\temp\myconfig.json";

var driver = new PhantomJSDriver(driverService);  // Launches PhantomJS.exe using JSON configuration file.
See Also