在不同的节点上运行多个实例-Selenium Grid

问题描述

我正在使用TestNG,Docker和GCP运行Selenium Grid。我有两个class(open1,open2) open2的代码与Firefox的代码完全相同,所不同的是使用Firefox而不是Chrome。 是否可以在一个具有多个实例的中心更多节点上运行? 在下面的图片中,您可以看到我可以与我的代码并行运行两个节点。 我如何才能并行运行所有10个实例和两个节点?

谢谢

package grid;

import java.net.MalformedURLException;
import java.net.URL;

import org.openqa.selenium.Platform;
import org.openqa.selenium.chrome.ChromeOptions;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.testng.annotations.BeforeClass;
import org.testng.annotations.Test;

public class open1 {
static RemoteWebDriver driver; 

@BeforeClass 
public void setUp () throws MalformedURLException {
    DesiredCapabilities cap = new DesiredCapabilities ();
    cap.setBrowserName("chrome");
    ChromeOptions options = new ChromeOptions();
    options.addArguments("disable-infobars");
    driver = new RemoteWebDriver(new URL ("http://35.xxx.xx.141:4444/wd/hub"),options);
    driver.manage().window().maximize();
}

@Test
public void googleSearch() {
    System.out.println("open1 startet");
    driver.get("https://www.google.de");
    driver.quit();
}}

还有XML文件:

 <!DOCTYPE suite SYSTEM "http://testng.org/testng-1.0.dtd" >
 <suite name="Suite" parallel="methods" >
   <test name="Test">
    <classes>
        <class name="grid.open1"/>
        <class name="grid.open2"/>
    </classes>
   </test>
</suite>

enter image description here

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)

相关问答

依赖报错 idea导入项目后依赖报错,解决方案:https://blog....
错误1:代码生成器依赖和mybatis依赖冲突 启动项目时报错如下...
错误1:gradle项目控制台输出为乱码 # 解决方案:https://bl...
错误还原:在查询的过程中,传入的workType为0时,该条件不起...
报错如下,gcc版本太低 ^ server.c:5346:31: 错误:‘struct...