ハブ/サーバー PC で実行されるコンソール アプリを使用して、リモート PC を Selenium ノードとして設定しようとしています。
プログラムをデバッグ モードで実行すると、「errorMessage」に次のテキストが表示されます。
The handle is invalid.
Connecting to 200.200.20.200:5555...
Couldn't access 200.200.20.200:5555
Connecting to 200.200.20.200:5555...
サーバーには次の場所に PsExec があります: D:\PSTools\PsExec.exe
サーバー IP: 100.100.10.100
リモート IP: 200.200.20.200
リモート PC の jar ファイルは次の場所に保存されます: D:\Selenium\selenium-server-standalone.jar
リモートPCで実行するコマンドは
D:\Selenium>java -jar selenium-server-standalone.jar -role node -hub http://100.100.10.100/grid/register
ここで何が欠けていますか
private static void StartSeleniumNode()
{
Process p = new Process();
p.StartInfo.UseShellExecute = false;
p.StartInfo.RedirectStandardOutput = true;
p.StartInfo.RedirectStandardError = true;
p.StartInfo.RedirectStandardInput = true;
p.StartInfo.FileName = @"D:\PSTools\PsExec.exe";
p.StartInfo.Arguments = @"\\200.200.20.200:5555 -u xyz -p abc123 -i -w D:\Selenium java -jar selenium-server-standalone.jar -role node -hub http://100.100.10.100:4444/grid/register";
p.Start();
string output = p.StandardOutput.ReadToEnd();
string errormessage = p.StandardError.ReadToEnd();
p.WaitForExit();
}