Programmatically open Selenium Hub and Node - ErrorDefaultRemoteProxy unknown version

classic Classic list List threaded Threaded
7 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Programmatically open Selenium Hub and Node - ErrorDefaultRemoteProxy unknown version

Darin Duphorn
Team,

I'm trying to programmatically start Selenium Hub and Node, but I'm having a difficult time passing the Version.  I've tried to pass through nodeConfiguration, and Capabilities, but I was not successful.

Below is the code that I'm using, in which I found most of it online. (Thanks for that everyone)

                    

                    String strIP = "Your IP";

                    //Launch Selenium Hub

        GridHubConfiguration config = new GridHubConfiguration();

        config.setTimeout(30000000);

                config.setPort(4444);

                Hub hub = new Hub(config);

                hub.start();

    

                RegistrationRequest req = new RegistrationRequest();

                req.setRole(GridRole.NODE);

                

                Map<String, Object> nodeConfiguration = new HashMap<String, Object>();

                nodeConfiguration.put(RegistrationRequest.PROXY_CLASS, "org.openqa.grid.selenium.proxy.DefaultRemoteProxy");

                nodeConfiguration.put(RegistrationRequest.MAX_SESSION, 5);

                nodeConfiguration.put(RegistrationRequest.PORT, 5555);

                nodeConfiguration.put(RegistrationRequest.HOST, 4444);

                nodeConfiguration.put(RegistrationRequest.AUTO_REGISTER, true);

                nodeConfiguration.put(RegistrationRequest.REGISTER_CYCLE, 5000);

                nodeConfiguration.put(RegistrationRequest.HUB_HOST, "localhost");

                nodeConfiguration.put(RegistrationRequest.HUB_PORT, 4444);

                nodeConfiguration.put("remoteHost", "http://"+strIP+":5555");

                nodeConfiguration.put("url", "http://"+strIP+":5555");

                nodeConfiguration.put("role", "node");

                nodeConfiguration.put("hub", "http://localhost:4444/grid/register");

                nodeConfiguration.put("Dwebdriver.chrome.driver=chromedriver", "");

                URL remoteURL = new URL("http://"+strIP+":5555");

                nodeConfiguration.put(RegistrationRequest.REMOTE_HOST, remoteURL);

                req.setConfiguration(nodeConfiguration);

                

                DesiredCapabilities capabilities2 = DesiredCapabilities.chrome();

                    capabilities2.setCapability("browserName","chrome");

                    capabilities2.setCapability("platform", "MAC");

                    capabilities2.setCapability("ensureCleanSession", "true");

                    capabilities2.setCapability("maxInstances",5);

                    

                req.addDesiredCapability(capabilities2);

                SelfRegisteringRemote remote = new SelfRegisteringRemote(req);

                try

                {

                remote.startRemoteServer();

                }

                catch (Exception f)

            {

                System.out.println(f); //Fails here org.openqa.grid.common.exception.GridConfigurationException: no server set to register to the hub            

                    }

                remote.startRegistrationProcess(); //I Let this run

                System.out.println("Stop Here"); //Break point Here


When this code runs, and I open my browser to localhost:4444/grid/console# it displays the below.


Any ides how I can pass the version? Or any idea why it says "no server set to register to the hub"?


Thanks for any help you can provide.




<img src="webkit-fake-url://db030537-8f4c-458a-bbcd-6a27d1a9842d/image.tiff">


--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/71082bc6-41a4-440b-8b8c-66168e204424%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Programmatically open Selenium Hub and Node - ErrorDefaultRemoteProxy unknown version

⇜Krishnan Mahadevan⇝
Darin,
The below code should help you get started:
import org.openqa.grid.common.GridRole;
import org.openqa.grid.common.RegistrationRequest;
import org.openqa.grid.internal.utils.GridHubConfiguration;
import org.openqa.grid.internal.utils.SelfRegisteringRemote;
import org.openqa.grid.selenium.proxy.DefaultRemoteProxy;
import org.openqa.grid.web.Hub;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.server.SeleniumServer;

import java.net.URL;
import java.util.HashMap;
import java.util.Map;

public class HubViaCode {
public static void main(String[] args) throws Exception {
String strIP = "localhost";
GridHubConfiguration config = new GridHubConfiguration();
config.setTimeout(30000000);
config.setPort(4444);
config.setHost(strIP);
Hub hub = new Hub(config);
hub.start();
RegistrationRequest req = new RegistrationRequest();
req.setRole(GridRole.NODE);
Map<String, Object> nodeConfiguration = new HashMap<>();
nodeConfiguration.put(RegistrationRequest.PROXY_CLASS, DefaultRemoteProxy.class.getName());
nodeConfiguration.put(RegistrationRequest.MAX_SESSION, 5);
nodeConfiguration.put(RegistrationRequest.PORT, 5555);
nodeConfiguration.put(RegistrationRequest.HOST, 4444);
nodeConfiguration.put(RegistrationRequest.AUTO_REGISTER, true);
nodeConfiguration.put(RegistrationRequest.REGISTER_CYCLE, 5000);
nodeConfiguration.put(RegistrationRequest.HUB_HOST, "localhost");
nodeConfiguration.put(RegistrationRequest.HUB_PORT, 4444);
nodeConfiguration.put("remoteHost", "http://" + strIP + ":5555");
nodeConfiguration.put("url", "http://" + strIP + ":5555");
nodeConfiguration.put("role", "node");
nodeConfiguration.put("hub", "http://localhost:4444/grid/register");
URL remoteURL = new URL("http://" + strIP + ":5555");
nodeConfiguration.put(RegistrationRequest.REMOTE_HOST, remoteURL.toExternalForm());
req.setConfiguration(nodeConfiguration);
DesiredCapabilities capabilities2 = DesiredCapabilities.chrome();
capabilities2.setCapability("browserName", "chrome");
capabilities2.setCapability("platform", "MAC");
capabilities2.setCapability("ensureCleanSession", "true");
capabilities2.setCapability("maxInstances", 5);
req.addDesiredCapability(capabilities2);
SelfRegisteringRemote remote = new SelfRegisteringRemote(req);
remote.setRemoteServer(new SeleniumServer(req.getConfiguration()));
remote.startRemoteServer();
remote.startRegistrationProcess();
Thread.currentThread().join();
}
}

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Tue, Apr 26, 2016 at 10:14 PM, Darin Duphorn <[hidden email]> wrote:
Team,

I'm trying to programmatically start Selenium Hub and Node, but I'm having a difficult time passing the Version.  I've tried to pass through nodeConfiguration, and Capabilities, but I was not successful.

Below is the code that I'm using, in which I found most of it online. (Thanks for that everyone)

                    

                    String strIP = "Your IP";

                    //Launch Selenium Hub

        GridHubConfiguration config = new GridHubConfiguration();

        config.setTimeout(30000000);

                config.setPort(4444);

                Hub hub = new Hub(config);

                hub.start();

    

                RegistrationRequest req = new RegistrationRequest();

                req.setRole(GridRole.NODE);

                

                Map<String, Object> nodeConfiguration = new HashMap<String, Object>();

                nodeConfiguration.put(RegistrationRequest.PROXY_CLASS, "org.openqa.grid.selenium.proxy.DefaultRemoteProxy");

                nodeConfiguration.put(RegistrationRequest.MAX_SESSION, 5);

                nodeConfiguration.put(RegistrationRequest.PORT, 5555);

                nodeConfiguration.put(RegistrationRequest.HOST, 4444);

                nodeConfiguration.put(RegistrationRequest.AUTO_REGISTER, true);

                nodeConfiguration.put(RegistrationRequest.REGISTER_CYCLE, 5000);

                nodeConfiguration.put(RegistrationRequest.HUB_HOST, "localhost");

                nodeConfiguration.put(RegistrationRequest.HUB_PORT, 4444);

                nodeConfiguration.put("remoteHost", "http://"+strIP+":5555");

                nodeConfiguration.put("url", "http://"+strIP+":5555");

                nodeConfiguration.put("role", "node");

                nodeConfiguration.put("hub", "http://localhost:4444/grid/register");

                nodeConfiguration.put("Dwebdriver.chrome.driver=chromedriver", "");

                URL remoteURL = new URL("http://"+strIP+":5555");

                nodeConfiguration.put(RegistrationRequest.REMOTE_HOST, remoteURL);

                req.setConfiguration(nodeConfiguration);

                

                DesiredCapabilities capabilities2 = DesiredCapabilities.chrome();

                    capabilities2.setCapability("browserName","chrome");

                    capabilities2.setCapability("platform", "MAC");

                    capabilities2.setCapability("ensureCleanSession", "true");

                    capabilities2.setCapability("maxInstances",5);

                    

                req.addDesiredCapability(capabilities2);

                SelfRegisteringRemote remote = new SelfRegisteringRemote(req);

                try

                {

                remote.startRemoteServer();

                }

                catch (Exception f)

            {

                System.out.println(f); //Fails here org.openqa.grid.common.exception.GridConfigurationException: no server set to register to the hub            

                    }

                remote.startRegistrationProcess(); //I Let this run

                System.out.println("Stop Here"); //Break point Here


When this code runs, and I open my browser to localhost:4444/grid/console# it displays the below.


Any ides how I can pass the version? Or any idea why it says "no server set to register to the hub"?


Thanks for any help you can provide.







--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/71082bc6-41a4-440b-8b8c-66168e204424%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLmAyXc91oiN4Jg%2By0XySSuWLVmrPZ980N3g5KmwEcNBoA%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Programmatically open Selenium Hub and Node - ErrorDefaultRemoteProxy unknown version

Vikram
Hey Krishnan,

Thanks for sharing below code, it's working fine.

But I didn't get the step  "Thread.currentThread().join();"

why is this needed ?

Thanks & Regards,
Vikram

On Friday, April 29, 2016 at 6:21:40 AM UTC+2, Krishnan wrote:
Darin,
The below code should help you get started:
import org.openqa.grid.common.GridRole;
import org.openqa.grid.common.RegistrationRequest;
import org.openqa.grid.internal.utils.GridHubConfiguration;
import org.openqa.grid.internal.utils.SelfRegisteringRemote;
import org.openqa.grid.selenium.proxy.DefaultRemoteProxy;
import org.openqa.grid.web.Hub;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.server.SeleniumServer;

import java.net.URL;
import java.util.HashMap;
import java.util.Map;

public class HubViaCode {
public static void main(String[] args) throws Exception {
String strIP = "localhost";
GridHubConfiguration config = new GridHubConfiguration();
config.setTimeout(30000000);
config.setPort(4444);
config.setHost(strIP);
Hub hub = new Hub(config);
hub.start();
RegistrationRequest req = new RegistrationRequest();
req.setRole(GridRole.NODE);
Map<String, Object> nodeConfiguration = new HashMap<>();
nodeConfiguration.put(RegistrationRequest.PROXY_CLASS, DefaultRemoteProxy.class.getName());
nodeConfiguration.put(RegistrationRequest.MAX_SESSION, 5);
nodeConfiguration.put(RegistrationRequest.PORT, 5555);
nodeConfiguration.put(RegistrationRequest.HOST, 4444);
nodeConfiguration.put(RegistrationRequest.AUTO_REGISTER, true);
nodeConfiguration.put(RegistrationRequest.REGISTER_CYCLE, 5000);
nodeConfiguration.put(RegistrationRequest.HUB_HOST, "localhost");
nodeConfiguration.put(RegistrationRequest.HUB_PORT, 4444);
nodeConfiguration.put("remoteHost", "http://" + strIP + ":5555");
nodeConfiguration.put("url", "http://" + strIP + ":5555");
nodeConfiguration.put("role", "node");
nodeConfiguration.put("hub", "<a href="http://localhost:4444/grid/register" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A4444%2Fgrid%2Fregister\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHiH156dSkwjcK-fQ41tfSxPDC1cQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A4444%2Fgrid%2Fregister\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHiH156dSkwjcK-fQ41tfSxPDC1cQ&#39;;return true;">http://localhost:4444/grid/register");
URL remoteURL = new URL("http://" + strIP + ":5555");
nodeConfiguration.put(RegistrationRequest.REMOTE_HOST, remoteURL.toExternalForm());
req.setConfiguration(nodeConfiguration);
DesiredCapabilities capabilities2 = DesiredCapabilities.chrome();
capabilities2.setCapability("browserName", "chrome");
capabilities2.setCapability("platform", "MAC");
capabilities2.setCapability("ensureCleanSession", "true");
capabilities2.setCapability("maxInstances", 5);
req.addDesiredCapability(capabilities2);
SelfRegisteringRemote remote = new SelfRegisteringRemote(req);
remote.setRemoteServer(new SeleniumServer(req.getConfiguration()));
remote.startRemoteServer();
remote.startRegistrationProcess();
Thread.currentThread().join();
}
}

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ <a href="http://wakened-cognition.blogspot.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;">http://wakened-cognition.blogspot.com/
My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;">http://rationaleemotions.wordpress.com/

On Tue, Apr 26, 2016 at 10:14 PM, Darin Duphorn <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="B2GZAPDfAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">neversto...@...> wrote:
Team,

I'm trying to programmatically start Selenium Hub and Node, but I'm having a difficult time passing the Version.  I've tried to pass through nodeConfiguration, and Capabilities, but I was not successful.

Below is the code that I'm using, in which I found most of it online. (Thanks for that everyone)

                    

                    String strIP = "Your IP";

                    //Launch Selenium Hub

        GridHubConfiguration config = new GridHubConfiguration();

        config.setTimeout(30000000);

                config.setPort(4444);

                Hub hub = new Hub(config);

                hub.start();

    

                RegistrationRequest req = new RegistrationRequest();

                req.setRole(GridRole.NODE);

                

                Map<String, Object> nodeConfiguration = new HashMap<String, Object>();

                nodeConfiguration.put(RegistrationRequest.PROXY_CLASS, "org.openqa.grid.selenium.proxy.DefaultRemoteProxy");

                nodeConfiguration.put(RegistrationRequest.MAX_SESSION, 5);

                nodeConfiguration.put(RegistrationRequest.PORT, 5555);

                nodeConfiguration.put(RegistrationRequest.HOST, 4444);

                nodeConfiguration.put(RegistrationRequest.AUTO_REGISTER, true);

                nodeConfiguration.put(RegistrationRequest.REGISTER_CYCLE, 5000);

                nodeConfiguration.put(RegistrationRequest.HUB_HOST, "localhost");

                nodeConfiguration.put(RegistrationRequest.HUB_PORT, 4444);

                nodeConfiguration.put("remoteHost", "http://"+strIP+":5555");

                nodeConfiguration.put("url", "http://"+strIP+":5555");

                nodeConfiguration.put("role", "node");

                nodeConfiguration.put("hub", "<a href="http://localhost:4444/grid/register" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A4444%2Fgrid%2Fregister\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHiH156dSkwjcK-fQ41tfSxPDC1cQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A4444%2Fgrid%2Fregister\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHiH156dSkwjcK-fQ41tfSxPDC1cQ&#39;;return true;">http://localhost:4444/grid/register");

                nodeConfiguration.put("Dwebdriver.chrome.driver=chromedriver", "");

                URL remoteURL = new URL("http://"+strIP+":5555");

                nodeConfiguration.put(RegistrationRequest.REMOTE_HOST, remoteURL);

                req.setConfiguration(nodeConfiguration);

                

                DesiredCapabilities capabilities2 = DesiredCapabilities.chrome();

                    capabilities2.setCapability("browserName","chrome");

                    capabilities2.setCapability("platform", "MAC");

                    capabilities2.setCapability("ensureCleanSession", "true");

                    capabilities2.setCapability("maxInstances",5);

                    

                req.addDesiredCapability(capabilities2);

                SelfRegisteringRemote remote = new SelfRegisteringRemote(req);

                try

                {

                remote.startRemoteServer();

                }

                catch (Exception f)

            {

                System.out.println(f); //Fails here org.openqa.grid.common.exception.GridConfigurationException: no server set to register to the hub            

                    }

                remote.startRegistrationProcess(); //I Let this run

                System.out.println("Stop Here"); //Break point Here


When this code runs, and I open my browser to localhost:4444/grid/console# it displays the below.


Any ides how I can pass the version? Or any idea why it says "no server set to register to the hub"?


Thanks for any help you can provide.







--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="B2GZAPDfAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">selenium-user...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="B2GZAPDfAgAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">seleniu...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/selenium-users/71082bc6-41a4-440b-8b8c-66168e204424%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/selenium-users/71082bc6-41a4-440b-8b8c-66168e204424%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/selenium-users/71082bc6-41a4-440b-8b8c-66168e204424%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/selenium-users/71082bc6-41a4-440b-8b8c-66168e204424%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0ef52aa8-1ae4-427f-809d-452fb826d0be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Programmatically open Selenium Hub and Node - ErrorDefaultRemoteProxy unknown version

⇜Krishnan Mahadevan⇝
Vikram,
I used to ensure that the main thread waits for any other threads within the Hub/Node logic to run to completion.If you don't use it, I guess the main method will run to completion and exit which I didn't want.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Tue, Dec 20, 2016 at 7:38 PM, Vikram <[hidden email]> wrote:
Hey Krishnan,

Thanks for sharing below code, it's working fine.

But I didn't get the step  "Thread.currentThread().join();"

why is this needed ?

Thanks & Regards,
Vikram

On Friday, April 29, 2016 at 6:21:40 AM UTC+2, Krishnan wrote:
Darin,
The below code should help you get started:
import org.openqa.grid.common.GridRole;
import org.openqa.grid.common.RegistrationRequest;
import org.openqa.grid.internal.utils.GridHubConfiguration;
import org.openqa.grid.internal.utils.SelfRegisteringRemote;
import org.openqa.grid.selenium.proxy.DefaultRemoteProxy;
import org.openqa.grid.web.Hub;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.server.SeleniumServer;

import java.net.URL;
import java.util.HashMap;
import java.util.Map;

public class HubViaCode {
public static void main(String[] args) throws Exception {
String strIP = "localhost";
GridHubConfiguration config = new GridHubConfiguration();
config.setTimeout(30000000);
config.setPort(4444);
config.setHost(strIP);
Hub hub = new Hub(config);
hub.start();
RegistrationRequest req = new RegistrationRequest();
req.setRole(GridRole.NODE);
Map<String, Object> nodeConfiguration = new HashMap<>();
nodeConfiguration.put(RegistrationRequest.PROXY_CLASS, DefaultRemoteProxy.class.getName());
nodeConfiguration.put(RegistrationRequest.MAX_SESSION, 5);
nodeConfiguration.put(RegistrationRequest.PORT, 5555);
nodeConfiguration.put(RegistrationRequest.HOST, 4444);
nodeConfiguration.put(RegistrationRequest.AUTO_REGISTER, true);
nodeConfiguration.put(RegistrationRequest.REGISTER_CYCLE, 5000);
nodeConfiguration.put(RegistrationRequest.HUB_HOST, "localhost");
nodeConfiguration.put(RegistrationRequest.HUB_PORT, 4444);
nodeConfiguration.put("remoteHost", "http://" + strIP + ":5555");
nodeConfiguration.put("url", "http://" + strIP + ":5555");
nodeConfiguration.put("role", "node");
nodeConfiguration.put("hub", "http://localhost:4444/grid/register");
URL remoteURL = new URL("http://" + strIP + ":5555");
nodeConfiguration.put(RegistrationRequest.REMOTE_HOST, remoteURL.toExternalForm());
req.setConfiguration(nodeConfiguration);
DesiredCapabilities capabilities2 = DesiredCapabilities.chrome();
capabilities2.setCapability("browserName", "chrome");
capabilities2.setCapability("platform", "MAC");
capabilities2.setCapability("ensureCleanSession", "true");
capabilities2.setCapability("maxInstances", 5);
req.addDesiredCapability(capabilities2);
SelfRegisteringRemote remote = new SelfRegisteringRemote(req);
remote.setRemoteServer(new SeleniumServer(req.getConfiguration()));
remote.startRemoteServer();
remote.startRegistrationProcess();
Thread.currentThread().join();
}
}

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ http://wakened-cognition.blogspot.com/
My Technical Scribbings @ http://rationaleemotions.wordpress.com/

On Tue, Apr 26, 2016 at 10:14 PM, Darin Duphorn <[hidden email]> wrote:
Team,

I'm trying to programmatically start Selenium Hub and Node, but I'm having a difficult time passing the Version.  I've tried to pass through nodeConfiguration, and Capabilities, but I was not successful.

Below is the code that I'm using, in which I found most of it online. (Thanks for that everyone)

                    

                    String strIP = "Your IP";

                    //Launch Selenium Hub

        GridHubConfiguration config = new GridHubConfiguration();

        config.setTimeout(30000000);

                config.setPort(4444);

                Hub hub = new Hub(config);

                hub.start();

    

                RegistrationRequest req = new RegistrationRequest();

                req.setRole(GridRole.NODE);

                

                Map<String, Object> nodeConfiguration = new HashMap<String, Object>();

                nodeConfiguration.put(RegistrationRequest.PROXY_CLASS, "org.openqa.grid.selenium.proxy.DefaultRemoteProxy");

                nodeConfiguration.put(RegistrationRequest.MAX_SESSION, 5);

                nodeConfiguration.put(RegistrationRequest.PORT, 5555);

                nodeConfiguration.put(RegistrationRequest.HOST, 4444);

                nodeConfiguration.put(RegistrationRequest.AUTO_REGISTER, true);

                nodeConfiguration.put(RegistrationRequest.REGISTER_CYCLE, 5000);

                nodeConfiguration.put(RegistrationRequest.HUB_HOST, "localhost");

                nodeConfiguration.put(RegistrationRequest.HUB_PORT, 4444);

                nodeConfiguration.put("remoteHost", "http://"+strIP+":5555");

                nodeConfiguration.put("url", "http://"+strIP+":5555");

                nodeConfiguration.put("role", "node");

                nodeConfiguration.put("hub", "http://localhost:4444/grid/register");

                nodeConfiguration.put("Dwebdriver.chrome.driver=chromedriver", "");

                URL remoteURL = new URL("http://"+strIP+":5555");

                nodeConfiguration.put(RegistrationRequest.REMOTE_HOST, remoteURL);

                req.setConfiguration(nodeConfiguration);

                

                DesiredCapabilities capabilities2 = DesiredCapabilities.chrome();

                    capabilities2.setCapability("browserName","chrome");

                    capabilities2.setCapability("platform", "MAC");

                    capabilities2.setCapability("ensureCleanSession", "true");

                    capabilities2.setCapability("maxInstances",5);

                    

                req.addDesiredCapability(capabilities2);

                SelfRegisteringRemote remote = new SelfRegisteringRemote(req);

                try

                {

                remote.startRemoteServer();

                }

                catch (Exception f)

            {

                System.out.println(f); //Fails here org.openqa.grid.common.exception.GridConfigurationException: no server set to register to the hub            

                    }

                remote.startRegistrationProcess(); //I Let this run

                System.out.println("Stop Here"); //Break point Here


When this code runs, and I open my browser to localhost:4444/grid/console# it displays the below.


Any ides how I can pass the version? Or any idea why it says "no server set to register to the hub"?


Thanks for any help you can provide.







--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/71082bc6-41a4-440b-8b8c-66168e204424%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/0ef52aa8-1ae4-427f-809d-452fb826d0be%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/CANikZLmi5nE3mBaYb51yWh35b1TQ%3DbeBMTLwdSLENuPbi-kefw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Programmatically open Selenium Hub and Node - ErrorDefaultRemoteProxy unknown version

Vikram
Hey Krishnan,

Thanks for detailed clarifications.

Regards,
Vikram

On Wednesday, December 21, 2016 at 4:08:04 AM UTC+1, Krishnan wrote:
Vikram,
I used to ensure that the main thread waits for any other threads within the Hub/Node logic to run to completion.If you don't use it, I guess the main method will run to completion and exit which I didn't want.

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ <a href="http://wakened-cognition.blogspot.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;">http://wakened-cognition.blogspot.com/
My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;">http://rationaleemotions.wordpress.com/

On Tue, Dec 20, 2016 at 7:38 PM, Vikram <<a href="javascript:" target="_blank" gdf-obfuscated-mailto="7zytIoJGEAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">vikra...@...> wrote:
Hey Krishnan,

Thanks for sharing below code, it's working fine.

But I didn't get the step  "Thread.currentThread().join();"

why is this needed ?

Thanks & Regards,
Vikram

On Friday, April 29, 2016 at 6:21:40 AM UTC+2, Krishnan wrote:
Darin,
The below code should help you get started:
import org.openqa.grid.common.GridRole;
import org.openqa.grid.common.RegistrationRequest;
import org.openqa.grid.internal.utils.GridHubConfiguration;
import org.openqa.grid.internal.utils.SelfRegisteringRemote;
import org.openqa.grid.selenium.proxy.DefaultRemoteProxy;
import org.openqa.grid.web.Hub;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.server.SeleniumServer;

import java.net.URL;
import java.util.HashMap;
import java.util.Map;

public class HubViaCode {
public static void main(String[] args) throws Exception {
String strIP = "localhost";
GridHubConfiguration config = new GridHubConfiguration();
config.setTimeout(30000000);
config.setPort(4444);
config.setHost(strIP);
Hub hub = new Hub(config);
hub.start();
RegistrationRequest req = new RegistrationRequest();
req.setRole(GridRole.NODE);
Map<String, Object> nodeConfiguration = new HashMap<>();
nodeConfiguration.put(RegistrationRequest.PROXY_CLASS, DefaultRemoteProxy.class.getName());
nodeConfiguration.put(RegistrationRequest.MAX_SESSION, 5);
nodeConfiguration.put(RegistrationRequest.PORT, 5555);
nodeConfiguration.put(RegistrationRequest.HOST, 4444);
nodeConfiguration.put(RegistrationRequest.AUTO_REGISTER, true);
nodeConfiguration.put(RegistrationRequest.REGISTER_CYCLE, 5000);
nodeConfiguration.put(RegistrationRequest.HUB_HOST, "localhost");
nodeConfiguration.put(RegistrationRequest.HUB_PORT, 4444);
nodeConfiguration.put("remoteHost", "http://" + strIP + ":5555");
nodeConfiguration.put("url", "http://" + strIP + ":5555");
nodeConfiguration.put("role", "node");
nodeConfiguration.put("hub", "<a href="http://localhost:4444/grid/register" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A4444%2Fgrid%2Fregister\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHiH156dSkwjcK-fQ41tfSxPDC1cQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A4444%2Fgrid%2Fregister\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHiH156dSkwjcK-fQ41tfSxPDC1cQ&#39;;return true;">http://localhost:4444/grid/register");
URL remoteURL = new URL("http://" + strIP + ":5555");
nodeConfiguration.put(RegistrationRequest.REMOTE_HOST, remoteURL.toExternalForm());
req.setConfiguration(nodeConfiguration);
DesiredCapabilities capabilities2 = DesiredCapabilities.chrome();
capabilities2.setCapability("browserName", "chrome");
capabilities2.setCapability("platform", "MAC");
capabilities2.setCapability("ensureCleanSession", "true");
capabilities2.setCapability("maxInstances", 5);
req.addDesiredCapability(capabilities2);
SelfRegisteringRemote remote = new SelfRegisteringRemote(req);
remote.setRemoteServer(new SeleniumServer(req.getConfiguration()));
remote.startRemoteServer();
remote.startRegistrationProcess();
Thread.currentThread().join();
}
}

Thanks & Regards
Krishnan Mahadevan

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"
My Scribblings @ <a href="http://wakened-cognition.blogspot.com/" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Fwakened-cognition.blogspot.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHzOdYJCASIDF_28vQtkp9gnKAYSQ&#39;;return true;">http://wakened-cognition.blogspot.com/
My Technical Scribbings @ <a href="http://rationaleemotions.wordpress.com/" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Frationaleemotions.wordpress.com%2F\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNEcBOKyRn0lpL8LDbBuyAlKdwgXwQ&#39;;return true;">http://rationaleemotions.wordpress.com/

On Tue, Apr 26, 2016 at 10:14 PM, Darin Duphorn <[hidden email]> wrote:
Team,

I'm trying to programmatically start Selenium Hub and Node, but I'm having a difficult time passing the Version.  I've tried to pass through nodeConfiguration, and Capabilities, but I was not successful.

Below is the code that I'm using, in which I found most of it online. (Thanks for that everyone)

                    

                    String strIP = "Your IP";

                    //Launch Selenium Hub

        GridHubConfiguration config = new GridHubConfiguration();

        config.setTimeout(30000000);

                config.setPort(4444);

                Hub hub = new Hub(config);

                hub.start();

    

                RegistrationRequest req = new RegistrationRequest();

                req.setRole(GridRole.NODE);

                

                Map<String, Object> nodeConfiguration = new HashMap<String, Object>();

                nodeConfiguration.put(RegistrationRequest.PROXY_CLASS, "org.openqa.grid.selenium.proxy.DefaultRemoteProxy");

                nodeConfiguration.put(RegistrationRequest.MAX_SESSION, 5);

                nodeConfiguration.put(RegistrationRequest.PORT, 5555);

                nodeConfiguration.put(RegistrationRequest.HOST, 4444);

                nodeConfiguration.put(RegistrationRequest.AUTO_REGISTER, true);

                nodeConfiguration.put(RegistrationRequest.REGISTER_CYCLE, 5000);

                nodeConfiguration.put(RegistrationRequest.HUB_HOST, "localhost");

                nodeConfiguration.put(RegistrationRequest.HUB_PORT, 4444);

                nodeConfiguration.put("remoteHost", "http://"+strIP+":5555");

                nodeConfiguration.put("url", "http://"+strIP+":5555");

                nodeConfiguration.put("role", "node");

                nodeConfiguration.put("hub", "<a href="http://localhost:4444/grid/register" rel="nofollow" target="_blank" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A4444%2Fgrid%2Fregister\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHiH156dSkwjcK-fQ41tfSxPDC1cQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A4444%2Fgrid%2Fregister\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHiH156dSkwjcK-fQ41tfSxPDC1cQ&#39;;return true;">http://localhost:4444/grid/register");

                nodeConfiguration.put("Dwebdriver.chrome.driver=chromedriver", "");

                URL remoteURL = new URL("http://"+strIP+":5555");

                nodeConfiguration.put(RegistrationRequest.REMOTE_HOST, remoteURL);

                req.setConfiguration(nodeConfiguration);

                

                DesiredCapabilities capabilities2 = DesiredCapabilities.chrome();

                    capabilities2.setCapability("browserName","chrome");

                    capabilities2.setCapability("platform", "MAC");

                    capabilities2.setCapability("ensureCleanSession", "true");

                    capabilities2.setCapability("maxInstances",5);

                    

                req.addDesiredCapability(capabilities2);

                SelfRegisteringRemote remote = new SelfRegisteringRemote(req);

                try

                {

                remote.startRemoteServer();

                }

                catch (Exception f)

            {

                System.out.println(f); //Fails here org.openqa.grid.common.exception.GridConfigurationException: no server set to register to the hub            

                    }

                remote.startRegistrationProcess(); //I Let this run

                System.out.println("Stop Here"); //Break point Here


When this code runs, and I open my browser to localhost:4444/grid/console# it displays the below.


Any ides how I can pass the version? Or any idea why it says "no server set to register to the hub"?


Thanks for any help you can provide.







--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to selenium-user...@googlegroups.com.
To post to this group, send email to [hidden email].
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/selenium-users/71082bc6-41a4-440b-8b8c-66168e204424%40googlegroups.com?utm_medium=email&amp;utm_source=footer" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/selenium-users/71082bc6-41a4-440b-8b8c-66168e204424%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/selenium-users/71082bc6-41a4-440b-8b8c-66168e204424%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/selenium-users/71082bc6-41a4-440b-8b8c-66168e204424%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" rel="nofollow" target="_blank" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="7zytIoJGEAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">selenium-user...@googlegroups.com.
To post to this group, send email to <a href="javascript:" target="_blank" gdf-obfuscated-mailto="7zytIoJGEAAJ" rel="nofollow" onmousedown="this.href=&#39;javascript:&#39;;return true;" onclick="this.href=&#39;javascript:&#39;;return true;">seleniu...@googlegroups.com.
To view this discussion on the web visit <a href="https://groups.google.com/d/msgid/selenium-users/0ef52aa8-1ae4-427f-809d-452fb826d0be%40googlegroups.com?utm_medium=email&amp;utm_source=footer" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/msgid/selenium-users/0ef52aa8-1ae4-427f-809d-452fb826d0be%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/msgid/selenium-users/0ef52aa8-1ae4-427f-809d-452fb826d0be%40googlegroups.com?utm_medium\x3demail\x26utm_source\x3dfooter&#39;;return true;">https://groups.google.com/d/msgid/selenium-users/0ef52aa8-1ae4-427f-809d-452fb826d0be%40googlegroups.com.
For more options, visit <a href="https://groups.google.com/d/optout" target="_blank" rel="nofollow" onmousedown="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;" onclick="this.href=&#39;https://groups.google.com/d/optout&#39;;return true;">https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/21b41557-5715-455a-acd2-e1a0048f933d%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Programmatically open Selenium Hub and Node - ErrorDefaultRemoteProxy unknown version

Sai Kiran-2
In reply to this post by Darin Duphorn
Dear Selenium Experts

I am kind of new to Selenium Grid. I am using selenium-server-standalone-3.4.0.jar and 
I am able to start HUB programatically, however I am unable to register nodes programatically, all of nodes are different windows computers in the same Network. 
 
 HUB is running on IP 192.168.1.10
 Nodes are at 
  • 192.168.1.11
  • 192.168.1.12
  • 192.168.1.13
  • 192.168.1.14
Could some one please guide me if there is a way to Register nodes from HUB computer?

Sai

On Wednesday, April 27, 2016 at 2:28:57 AM UTC-4, Darin Duphorn wrote:
Team,

I'm trying to programmatically start Selenium Hub and Node, but I'm having a difficult time passing the Version.  I've tried to pass through nodeConfiguration, and Capabilities, but I was not successful.

Below is the code that I'm using, in which I found most of it online. (Thanks for that everyone)

                    

                    String strIP = "Your IP";

                    //Launch Selenium Hub

        GridHubConfiguration config = new GridHubConfiguration();

        config.setTimeout(30000000);

                config.setPort(4444);

                Hub hub = new Hub(config);

                hub.start();

    

                RegistrationRequest req = new RegistrationRequest();

                req.setRole(GridRole.NODE);

                

                Map<String, Object> nodeConfiguration = new HashMap<String, Object>();

                nodeConfiguration.put(RegistrationRequest.PROXY_CLASS, "org.openqa.grid.selenium.proxy.DefaultRemoteProxy");

                nodeConfiguration.put(RegistrationRequest.MAX_SESSION, 5);

                nodeConfiguration.put(RegistrationRequest.PORT, 5555);

                nodeConfiguration.put(RegistrationRequest.HOST, 4444);

                nodeConfiguration.put(RegistrationRequest.AUTO_REGISTER, true);

                nodeConfiguration.put(RegistrationRequest.REGISTER_CYCLE, 5000);

                nodeConfiguration.put(RegistrationRequest.HUB_HOST, "localhost");

                nodeConfiguration.put(RegistrationRequest.HUB_PORT, 4444);

                nodeConfiguration.put("remoteHost", "http://"+strIP+":5555");

                nodeConfiguration.put("url", "http://"+strIP+":5555");

                nodeConfiguration.put("role", "node");

                nodeConfiguration.put("hub", "<a href="http://localhost:4444/grid/register" target="_blank" rel="nofollow" onmousedown="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A4444%2Fgrid%2Fregister\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHiH156dSkwjcK-fQ41tfSxPDC1cQ&#39;;return true;" onclick="this.href=&#39;http://www.google.com/url?q\x3dhttp%3A%2F%2Flocalhost%3A4444%2Fgrid%2Fregister\x26sa\x3dD\x26sntz\x3d1\x26usg\x3dAFQjCNHiH156dSkwjcK-fQ41tfSxPDC1cQ&#39;;return true;">http://localhost:4444/grid/register");

                nodeConfiguration.put("Dwebdriver.chrome.driver=chromedriver", "");

                URL remoteURL = new URL("http://"+strIP+":5555");

                nodeConfiguration.put(RegistrationRequest.REMOTE_HOST, remoteURL);

                req.setConfiguration(nodeConfiguration);

                

                DesiredCapabilities capabilities2 = DesiredCapabilities.chrome();

                    capabilities2.setCapability("browserName","chrome");

                    capabilities2.setCapability("platform", "MAC");

                    capabilities2.setCapability("ensureCleanSession", "true");

                    capabilities2.setCapability("maxInstances",5);

                    

                req.addDesiredCapability(capabilities2);

                SelfRegisteringRemote remote = new SelfRegisteringRemote(req);

                try

                {

                remote.startRemoteServer();

                }

                catch (Exception f)

            {

                System.out.println(f); //Fails here org.openqa.grid.common.exception.GridConfigurationException: no server set to register to the hub            

                    }

                remote.startRegistrationProcess(); //I Let this run

                System.out.println("Stop Here"); //Break point Here


When this code runs, and I open my browser to localhost:4444/grid/console# it displays the below.


Any ides how I can pass the version? Or any idea why it says "no server set to register to the hub"?


Thanks for any help you can provide.







--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c99b88c1-25d3-4c99-bcdb-96cc90d0cc8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: Programmatically open Selenium Hub and Node - ErrorDefaultRemoteProxy unknown version

⇜Krishnan Mahadevan⇝

Sai Kiran,

 

You cannot programmatically wire in node to a hub when the machines on which they run are different.

 

When you wire in a node to a hub via code, it would be done in the same JVM.

 

So you would need to resort to the manual way of registering nodes to hub as detailed in the wiki page of Grid2.

 

Thanks & Regards

Krishnan Mahadevan

 

"All the desirable things in life are either illegal, expensive, fattening or in love with someone else!"

My Scribblings @ http://wakened-cognition.blogspot.com/

My Technical Scribbings @ http://rationaleemotions.wordpress.com/

 

From: <[hidden email]> on behalf of Sai Kiran <[hidden email]>
Reply-To: <[hidden email]>
Date: Sunday, June 4, 2017 at 5:17 PM
To: Selenium Users <[hidden email]>
Subject: [selenium-users] Re: Programmatically open Selenium Hub and Node - ErrorDefaultRemoteProxy unknown version

 

Dear Selenium Experts

 

I am kind of new to Selenium Grid. I am using selenium-server-standalone-3.4.0.jar and 

I am able to start HUB programatically, however I am unable to register nodes programatically, all of nodes are different windows computers in the same Network. 

 

 HUB is running on IP 192.168.1.10

 Nodes are at 

  • 192.168.1.11
  • 192.168.1.12
  • 192.168.1.13
  • 192.168.1.14

Could some one please guide me if there is a way to Register nodes from HUB computer?

 

Sai


On Wednesday, April 27, 2016 at 2:28:57 AM UTC-4, Darin Duphorn wrote:

Team,

 

I'm trying to programmatically start Selenium Hub and Node, but I'm having a difficult time passing the Version.  I've tried to pass through nodeConfiguration, and Capabilities, but I was not successful.

 

Below is the code that I'm using, in which I found most of it online. (Thanks for that everyone)

 

                    

                    String strIP = "Your IP";

                    //Launch Selenium Hub

                GridHubConfiguration config = new GridHubConfiguration();

                config.setTimeout(30000000);

                config.setPort(4444);

                Hub hub = new Hub(config);

                hub.start();

                 

                RegistrationRequest req = new RegistrationRequest();

                req.setRole(GridRole.NODE);

                

                Map<String, Object> nodeConfiguration = new HashMap<String, Object>();

                nodeConfiguration.put(RegistrationRequest.PROXY_CLASS, "org.openqa.grid.selenium.proxy.DefaultRemoteProxy");

                nodeConfiguration.put(RegistrationRequest.MAX_SESSION, 5);

                nodeConfiguration.put(RegistrationRequest.PORT, 5555);

                nodeConfiguration.put(RegistrationRequest.HOST, 4444);

                nodeConfiguration.put(RegistrationRequest.AUTO_REGISTER, true);

                nodeConfiguration.put(RegistrationRequest.REGISTER_CYCLE, 5000);

                nodeConfiguration.put(RegistrationRequest.HUB_HOST, "localhost");

                nodeConfiguration.put(RegistrationRequest.HUB_PORT, 4444);

                nodeConfiguration.put("remoteHost", "http://"+strIP+":5555");

                nodeConfiguration.put("url", "http://"+strIP+":5555");

                nodeConfiguration.put("role", "node");

                nodeConfiguration.put("hub", "http://localhost:4444/grid/register");

                nodeConfiguration.put("Dwebdriver.chrome.driver=chromedriver", "");

                URL remoteURL = new URL("http://"+strIP+":5555");

                nodeConfiguration.put(RegistrationRequest.REMOTE_HOST, remoteURL);

                req.setConfiguration(nodeConfiguration);

                

                DesiredCapabilities capabilities2 = DesiredCapabilities.chrome();

                    capabilities2.setCapability("browserName","chrome");

                    capabilities2.setCapability("platform", "MAC");

                    capabilities2.setCapability("ensureCleanSession", "true");

                    capabilities2.setCapability("maxInstances",5);

                    

                req.addDesiredCapability(capabilities2);

                SelfRegisteringRemote remote = new SelfRegisteringRemote(req);

                try

                {

                  remote.startRemoteServer();

                }

                catch (Exception f)

                {

                  System.out.println(f); //Fails here org.openqa.grid.common.exception.GridConfigurationException: no server set to register to the hub            

                    }

                remote.startRegistrationProcess(); //I Let this run

                System.out.println("Stop Here"); //Break point Here

 

When this code runs, and I open my browser to localhost:4444/grid/console# it displays the below.

 

Any ides how I can pass the version? Or any idea why it says "no server set to register to the hub"?

 

Thanks for any help you can provide.

 

 

 

 

 

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/c99b88c1-25d3-4c99-bcdb-96cc90d0cc8c%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.

--
You received this message because you are subscribed to the Google Groups "Selenium Users" group.
To unsubscribe from this group and stop receiving emails from it, send an email to [hidden email].
To post to this group, send email to [hidden email].
To view this discussion on the web visit https://groups.google.com/d/msgid/selenium-users/21B73F2C-2882-405D-8F19-7B92C3B2068A%40gmail.com.
For more options, visit https://groups.google.com/d/optout.
Loading...