diff --git a/lib/config.ts b/lib/config.ts index 36d2d4f1a..59790203f 100644 --- a/lib/config.ts +++ b/lib/config.ts @@ -46,6 +46,13 @@ export interface Config { * seleniumArgs: ['-browserTimeout=60'] */ args?: any; + + /** + * Additional command line jvm options to pass to selenium. For example, + * if you need to change the browser driver, use + * jvmArgs: ['-Dwebdriver.ie.driver=IEDriverServer_Win32_2.53.1.exe'] + */ + jvmArgs?: string[]; }; /** * ChromeDriver location is used to help find the chromedriver binary. @@ -588,6 +595,7 @@ export interface Config { ng12Hybrid?: boolean; seleniumArgs?: Array; + jvmArgs?: string[]; configDir?: string; troubleshoot?: boolean; seleniumPort?: number; diff --git a/lib/driverProviders/local.ts b/lib/driverProviders/local.ts index 6bdc8b723..91987c445 100644 --- a/lib/driverProviders/local.ts +++ b/lib/driverProviders/local.ts @@ -89,13 +89,16 @@ export class Local extends DriverProvider { if (serverConf.args === undefined) { serverConf.args = this.config_.seleniumArgs || []; } + if (serverConf.jvmArgs === undefined) { + serverConf.jvmArgs = this.config_.jvmArgs || []; + } if (serverConf.port === undefined) { serverConf.port = this.config_.seleniumPort; } // configure server if (this.config_.chromeDriver) { - serverConf.args.push('-Dwebdriver.chrome.driver=' + this.config_.chromeDriver); + serverConf.jvmArgs.push('-Dwebdriver.chrome.driver=' + this.config_.chromeDriver); } this.server_ = new remote.SeleniumServer(this.config_.seleniumServerJar, serverConf);