无法在selenium中将节点注册到集线器

时间:2017-06-04 18:53:57

标签: selenium selenium-webdriver selenium-grid

我的集线器正在成功运行并正在运行

    java -jar selenium-server-standalone-2.53.0.jar -role hub -port 5555

我的节点命令

  java -jar selenium-server-standalone-2.53.0.jar -role webdriver –hub http://localhost:5555/gridhost/register -port 7621

无法注册我的节点禁止+ +代理集线器已关闭或无响应

3 个答案:

答案 0 :(得分:0)

尝试另一个端口:

  

java -jar selenium-server-standalone-2.53.0.jar -role hub -port 4444

然后

  

java -jar selenium-server-standalone-2.53.0.jar -role webdriver -hub   http://localhost:4444/gridhost/register -port 7621

它适合我

答案 1 :(得分:0)

注册网址不应为Channels

请将其更改为http://localhost:5555/gridhost/register,然后重试。

答案 2 :(得分:0)

以下是您的问题的答案:

假设您需要在端口5555上运行Selenium Grid Hub,您必须考虑默认情况下Selenium Grid Node在端口5555上运行。当您设置Hub&在本地主机上节点并在端口5555上启动了集线器,您必须考虑将节点配置为在5555以外的其他端口上运行。这将解决您的问题。

如果在端口5555上运行Selenium Grid Hub不是强制性要求,那么您可以在默认端口(端口4444)或任何其他端口(例如,端口5786)上启动Selenium Grid Hub。端口5786

以下是供您参考的步骤:

  1. 启动Selenium Grid Server(在端口java -jar selenium-server-standalone-3.4.0.jar -role hub -port 5786 上):

    2017-06-05 12:22:03.092:INFO:osjs.Server:main: Started @1917ms
    12:22:03.093 INFO - Nodes should register to http://192.168.0.101:5786/grid/register/
    12:22:03.094 INFO - Selenium Grid hub is up and running
    
  2. 以下日志确认您的Selenium Grid Hub正常运行:

    http://localhost:5786/grid/console
    
  3. 通过以下网址访问Selenium Grid Console:

    java -jar selenium-server-standalone-3.4.0.jar -role node -hub http://localhost:5786/grid/register
    
  4. 启动Selenium网格节点:

    12:49:46.805 INFO - Selenium Grid node is up and ready to register to the hub
    12:49:46.927 INFO - Registering the node to the hub: http://localhost:5786/grid/register
    12:49:47.166 INFO - The node is registered to the hub and ready to use
    
  5. 以下日志确认您的Selenium网格节点正常运行:

    http://localhost:5786/grid/console
    
  6. 通过控制台URL访问Selenium Grid Console以查看已注册的节点:

    package mvc;
    
    import javafx.scene.Scene;
    import javafx.scene.control.Button;
    import javafx.scene.control.TextField;
    import javafx.scene.layout.FlowPane;
    
    public class View  {
    private TextField tf1;
    private TextField tf2;
    private Button b;
    private Scene scene;
    
    public View() {
        tf1 = new TextField();
        tf2 = new TextField();
        b = new Button("Copy");
    
        FlowPane fp = new FlowPane();
        fp.getChildren().addAll(tf1, b, tf2);
    
        scene = new Scene(fp, 600, 200);
    }
    
    public Scene getScene() {
        return scene;
    }
    
    public void setScene(Scene scene) {
        this.scene = scene;
    }
    
    public TextField getTf1() {
        return tf1;
    }
    
    public void setTf1(TextField tf1) {
        this.tf1 = tf1;
    }
    
    public TextField getTf2() {
        return tf2;
    }
    
    public void setTf2(TextField tf2) {
        this.tf2 = tf2;
    }
    
    public Button getB() {
        return b;
    }
    
    public void setB(Button b) {
        this.b = b;
    }
    }
    
  7. 如果这回答你的问题,请告诉我。