If i understand your question correctly you want to know how to pass driver options to remote driver.In that case where ever you are creating driver object you need to create desire capabilities and use one of the constructor of the remote driver with capability parameter. For example
DesiredCapabilities capabilities = DesiredCapabilities.chrome();
ChromeOptions options = new ChromeOptions();
options.addArguments("--start-maximized");
capabilities.setCapability(ChromeOptions.CAPABILITY, options);
driver = new RemoteWebDriver(URL, capabilities);
//driver = new ChromeDriver(capabilities);
You also can use QAF which abstraction driver configuration and management outside the code. Where you can set driver capabilities by using properties. As alternate You also can use Driver listener for such purpose. For example:
Using Properties:
Following two properties will do the needful for chrome driver:
drive.name=chromeDriver
chrome.additional.capabilities={"chromeOptions":{"args":["--start-maximized"]}}
For remote driver:
remote.server=<remote server or grid url>
drive.name=chromeRemoteDriver
chrome.additional.capabilities={"chromeOptions":{"args":["--start-maximized"]}}
Using Listener:
void beforeInitialize(Capabilities capabilities){
if(capabilities.getBrowserName().equalIgnorCase("chrome"){
ChromeOptions options = new ChromeOptions();
options.addArguments("--start-maximized");
((DesiredCapabilities)capabilities).setCapability(ChromeOptions.CAPABILITY, options);
}
}
void onInitialize(QAFExtendedWebDriver driver){
//for browser other than chrome...
driver.manage().window().maximize();
}