简体   繁体   中英

Start a selenium hub on a remote machine programmatically

How can we start a selenium grid hub on a remote machine programmatically?

As of now, i know the following ways of doing it but i have some questions on those.

Approach 1: Execute a batch file on remote machine with required command (java -jar selenium-server-standalone-2.14.0.jar -role hub) to start the hub. (using PSExec to execute command on remote machine)

No questions and issues with above approach. But looking for an API way of doing this .

Approach 2: This approach (I didn't try this way since these are JAVA APIs and i have very little knowledge in JAVA).

Q1: Can we use the above approach to start the hub on a remote machine?

Q2: Does selenium server jar file is required in this approach?

Can we use these APIs in our program (some how making a POST or GET http request with required configuration in JSON ) to configure Hub on a remote machine and start it? (I know console way of using these APIs with selenium server jar file)

The only way to start selenium grid is by running command on remote machine using the below command

java -jar Selenium-server.jar -role hub

you can make a batch file for this command to ease of use specifiy the name of jar file with your file

试试这个RemoteWebDriver rWD =新的RemoteWebDriver(新的URL(“ http://” + {{Hub_Name}} +“:4444 / wd / hub”),desiredCapabilities);

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM