1 回答
TA贡献1712条经验 获得超3个赞
在SpawnNodeServlet中,您应该删除类字段nodeArgs,并将nodeArgs定义为本地方法变量。
您有实例字段:
private final List<String> nodeArgs = new ArrayList<String>();
第一次服务调用后列表包含:
"-Dwebdriver.chrome.driver=\"libs//chromedriver\""
"-cp"
"hub/target/hub-1.0.0-jar-with-dependencies.jar:node/target/node-1.0.0-jar-with-dependencies.jar"
"org.openqa.grid.selenium.GridLauncherV3"
"-role"
"node"
"-nodeConfig"
"node/config.json"
第二次调用后:
"-Dwebdriver.chrome.driver=\"libs//chromedriver\""
"-cp"
"hub/target/hub-1.0.0-jar-with-dependencies.jar:node/target/node-1.0.0-jar-with-dependencies.jar"
"org.openqa.grid.selenium.GridLauncherV3"
"-role"
"node"
"-nodeConfig"
"node/config.json"
"-Dwebdriver.chrome.driver=\"libs//chromedriver\""
"-cp"
"hub/target/hub-1.0.0-jar-with-dependencies.jar:node/target/node-1.0.0-jar-with-dependencies.jar"
"org.openqa.grid.selenium.GridLauncherV3"
"-role"
"node"
"-nodeConfig"
"node/config.json"
然后您将此列表传递给执行者:
instanceExecutor.execute(nodeArgs);
这不是有效的 java 参数列表。
添加回答
举报