0

I'm automating my test cases in c# using selenium Grid, I have hub as my windows machine and my node is MAC. I wanted to run multiple browsers on node machine, say Firefox, Chrome, Safari.

My hub command line is

java -jar selenium-server-standalone-2.48.2.jar -role hub

My node command line is

enjava -jar selenium-server-standalone-2.48.2.jar -Dwebdriver.chrome.driver="chromedriver.exe" -role node -hub http://ip:4444/grid/register -port 4507 -browser browserName=chrome maInstances=5, maxSessoin=5 -browser browserName=firefox maxInstances=5, maxSessoin=5 -browser browserName=safari maxInstances=5, maxSessoin=5

My C# snippet

    public static RemoteWebDriver Instance { get; set; }
    public static void Initialize()
    {
        DesiredCapabilities capabilities = new DesiredCapabilities();
        capabilities = DesiredCapabilities.Firefox();
        capabilities = DesiredCapabilities.Chrome();
        capabilities = DesiredCapabilities.Safari();
        capabilities.SetCapability(CapabilityType.BrowserName, "firefox");
        capabilities.SetCapability(CapabilityType.BrowserName, "chrome");
        capabilities.SetCapability(CapabilityType.BrowserName, "safari");
        capabilities.SetCapability(CapabilityType.Platform, new Platform(PlatformType.Mac));
        Instance = new RemoteWebDriver(new Uri("http://ip:4507/wd/hub"), capabilities);

    }
cashanzlo
  • 121
  • 2
  • 5
  • 13
  • What exactly is the question ? Can you please clarify ? Oh btw your Initialize() method has a problem. You are merely overwriting the browser name and eventually its getting set to "safari". – Krishnan Mahadevan Jul 17 '16 at 06:08
  • My question is "How to automate multiple browsers at the same time in the node machine? using selenium grid". And what will be the changes I've to do in my code – cashanzlo Jul 18 '16 at 16:18
  • Did you run the hub before the node? – Moshisho Nov 16 '16 at 18:30

0 Answers0