0

I have a running Selenium Hub, but I want to start a large number of Selenium Nodes to run off it. I'm trying to do so in PowerShell, but I don't really care what tool gets the job done.

The command to do so is

java `-Dwebdriver.chrome.driver="C:\chromedriver.exe" `-jar selenium-server-standalone-3.13.0.jar `-role node `-hub http://localhost:4444/grid/register `-browser "browserName=chrome,version=67,maxInstances=5,seleniumProtocol=WebDriver"

So I've tried

start "Title1" java `-Dwebdriver.chrome.driver="C:\chromedriver.exe" `-jar selenium-server-standalone-3.13.0.jar `-role node `-hub http://localhost:4444/grid/register `-browser "browserName=chrome,version=67,maxInstances=5,seleniumProtocol=WebDriver"
start "Title2" java `-Dwebdriver.chrome.driver="C:\chromedriver.exe" `-jar selenium-server-standalone-3.13.0.jar `-role node `-hub http://localhost:4444/grid/register `-browser "browserName=chrome,version=67,maxInstances=5,seleniumProtocol=WebDriver"

This just gives me this error without starting a node

Start-Process : A positional parameter cannot be found that accepts argument '-jar'.

I suspect that part of the problem is all of the various quote marks in the command. I've also tried

$command = `-Dwebdriver.chrome.driver="C:\chromedriver.exe" `-jar selenium-server-standalone-3.13.0.jar `-role node `-hub http://localhost:4444/grid/register `-browser "browserName=chrome,version=67,maxInstances=5,seleniumProtocol=WebDriver"
start "Title1" java $command
start "Title2" java $command

along with a few other varients of that with different parts of the command as different variables.

1 Answer 1

0

From: Run Multiple Powershell Scripts Sequentially - on a Folder - Combine Scripts into a Master Script

Simply create a text file, using any code editor or text editor, and use the following example batch script:

start /min powershell.exe C:\your folder\script.ps1
start /min powershell.exe C:\your folder\script.ps1

Save it as a script.bat and open it. This will make two powershell scripts run at the same time.

The script itself just read

cd c:\
java `-Dwebdriver.chrome.driver="C:\chromedriver.exe" `-jar selenium-server-standalone-3.13.0.jar `-role node `-hub http://localhost:4444/grid/register `-browser "browserName=chrome,version=67,maxInstances=5,seleniumProtocol=WebDriver"
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.