1 回答

TA貢獻(xiàn)1712條經(jīng)驗(yàn) 獲得超3個(gè)贊
在SpawnNodeServlet中,您應(yīng)該刪除類字段nodeArgs,并將nodeArgs定義為本地方法變量。
您有實(shí)例字段:
private final List<String> nodeArgs = new ArrayList<String>();
第一次服務(wù)調(diào)用后列表包含:
"-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"
第二次調(diào)用后:
"-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"
然后您將此列表傳遞給執(zhí)行者:
instanceExecutor.execute(nodeArgs);
這不是有效的 java 參數(shù)列表。
添加回答
舉報(bào)