Is there such functionality for Selenium, where one can mention the selenium server configuration in any properties file, and before starting the server it automatically reads properties from that properties files and executes accordingly i.e. it can execute multiple instances, different browsers on different machines with different ports. I know that we can configure this programmatically or through json or command prompt.
Right now I am manually writing a properties file, reading it progrmmatically and configuring the selenium server programmatically.
I am configuring selenium using these methods,
Properties properties = new Properties();
DesiredCapabilities capability = DesiredCapabilities.firefox();
capability.setBrowserName(properties.get("Browser"));
capability.setVersion(properties.get("Version"));
capability.setPlatform(Platform.valueOf(properties.get("Platform")));
selenium = new DefaultSelenium(properties.get("Host"), Integer.parseInt(properties.get("Port")), properties.get("browser") ,url);
seleniumserver.start();
selenium.start();
What I want is instead of doing all this if there is a feature provided by selenium where it would read the properties file , configure capabilites, host etc. and then it just runs the server on calling seleniumserver.start(); and selenium.start();
As far as I know there’s is no such feature. The best option you have is to write it manually, like you’re doing now.
In past projects I’ve created a configuration class that read/received the selenium parameters and then served as a singleton for any query about the configuration.