Friday, 20 January 2012

hub.bat + webdriver.bat + JSON configuration

Hope someone will consider it helpful. Do not forget to resolve the ports at firewall.

hub.bat
@echo off
cd c:\selenium
java -jar selenium-server-standalone-2.14.0.jar -role hub
webdriver.bat
@echo off
cd c:\selenium
java -jar selenium-server-standalone-2.14.0.jar -role webdriver -nodeConfig myconfig.json -hub http://localhost:4444/grid/register

myconfig.json
{
"capabilities":
        [
                {
                        "browserName":"firefox",
                        "maxInstances":2
                },
                {
                        "browserName":"chrome",
                        "maxInstances":2,
                        "platform":"WINDOWS",
                },
                {
                        "browserName":"internet explorer",
                        "version":"9",
                        "javascriptEnabled":true,
                        "platform":"WINDOWS",
                        "maxInstances":2
                }
        ],
"configuration":
        {
                "cleanUpCycle":2000,
                "timeout":10000,
                "proxy":"org.openqa.grid.selenium.proxy.WebDriverRemoteProxy",
                "maxSession":5,
                "url":"http://127.0.0.1:5556/wd/hub",
        }
}

No comments:

Post a Comment