Friday, May 25, 2012

Grid with config file

config.txt for starting firefox in custom location

{
"capabilities":
        [
                {
                        "browserName":"firefox",
                        "acceptSslCerts":true,
                        "javascriptEnabled":true,
                        "takesScreenshot":true,
                        "firefox_binary":"c:\\Program Files\\FF9\\firefox.exe",
                        "maxInstances":5,
                       "version":"9"
                },
                {
                        "browserName":"chrome",
                        "maxInstances":5
                },
                {
                        "browserName":"internet explorer",
                        "platform":WINDOWS
                }
        ],
"configuration":
        {
                "cleanUpCycle":2000,
                "proxy":"org.openqa.grid.selenium.proxy.WebDriverRemoteProxy",
                "maxSession":5,
                "port": 5561,
                "hubPort" : 4444
        }
}

Sample node : java -jar selenium-server-standalone-2.20.0.jar -role node -hub http://ip of machine:4444/grid/register -port 5561 -nodeConfig config.txt




Java code to invoke it


DesiredCapabilities caps = DesiredCapabilites.firefox();
caps.setVersion("9.0");
caps.setBrowserName("firefox");

No comments:

Post a Comment