1

I have one scenario i.e.. I have one web view to take all actions(click,send-keys,opening new window) and locator types(ex: xpath,id,name and cssClassName) with these values I am going to create a selenium script and executing using selenium grid (All these things will be happens with the help of servlets).

My Issue : Lets take the sample scenario, I have three machines A,B and C . In the machine A is configured as a server hub and Machine B and C are configured as a Node's . So when I am try to create and execute the selenium script through WebUI(which is explained above) ,the browsers was opening in either machine B or C but I want to open a browser in which machine webUI was used to create a selenium script.Is it possible ???.If yes please let me know

2 Answers 2

1

Each node has three configuration items: browserName, version and platform. The version is a "free" format. If you give each of your nodes a made up version name (999,998 and 997) then you can use the Grid capability to force a test the run on the version name of choice.

Start the nodes with

 -browser version=999

In your test ask for a capability:

capability.setVersion("999");  

If only one node has this version, the test should start the run on that node.

For more info about Grid configration look at: https://code.google.com/p/selenium/wiki/Grid2

6
  • Hello Niels, Thanks for your answer . While using your code ,it's giving a compilation error "The method setPlatform(Platform) in the type DesiredCapabilities is not applicable for the arguments (String)"
    – QAMember
    Commented Jul 3, 2015 at 8:34
  • Hmm, think your right, the platforms are not a free format (code.google.com/p/selenium/wiki/GridPlatforms), please try the version then, make up a version number. Was a long time ago, but I have done something similar in the past, not sure of all the details. Commented Jul 3, 2015 at 8:44
  • Seems there is also an undocumented "applicationName" code.google.com/p/selenium/issues/detail?id=3660 Commented Jul 3, 2015 at 8:46
  • Hello Niels, some how I achieved to execute on a specific node but it fails with other than my node(localhost).I am not sure it is problem with my hub url (ipadress:4444/grid/register) or some thing else ??? please help me
    – QAMember
    Commented Jul 4, 2015 at 5:22
  • These are the log messages I can able to see in hub console when I am running from my node(I mean hub and node are located in same machine)
    – QAMember
    Commented Jul 4, 2015 at 5:25
0
        // settings.setBrowserName("firefox");
        settings.setPlatform(Platform.WIN8_1);
        // Node 1 will be Launched with FF in  Windows 8 

        settings.setBrowserName("chrome");
        settings.setPlatform(Platform.LINUX);

        // Node 2 will be launched with Chrome in Linux

        driver = new RemoteWebDriver(hubURL, settings);



        driver.manage().window().maximize();
        // Maximize the Browser
1
  • What if the platform and browsers combinations are the same for both nodes, because I think that is the question. Commented Oct 2, 2015 at 15:16

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.