问题
I have gone through the video deeply and tried it but I am struck, please help.
- 1) I tried the code but i getting error of:
org.openqa.selenium.SessionNotCreatedException: Unable to create new service: EdgeDriverService
Errors Image
So then later I found that there is a change to create a node for this error so i tried to create node by :
java -Dwebdriver.edge.driver=C:\MicrosoftWebDriver.exe -jar C:\selenium-server-standalone-3.8.1.jar -role node webdriver -hub http://10.144.102.48:4444/grid/register -port 5566
and also:
java -Dwebdriver.edge.driver=C:\MicrosoftWebDriver.exe -jar C:\selenium-server-standalone-3.8.1.jar -role node webdriver -hub
Note: I am using a new VM with different IP address and I have downloaded MicrosoftWebDriver.exe
and C:\selenium-server-standalone-3.8.1
in the fresh VM.
enter image description here
回答1:
The problem lies in your startup command for the node.
Valid values for role are either hub
(To start the hub) (or) node
(to start the JVM in the node mode) and no value which causes the JVM to come up in a standalone mode.
You provided
java -Dwebdriver.edge.driver=C:\MicrosoftWebDriver.exe -jar C:\selenium-server-standalone-3.8.1.jar -role node webdriver -hub http://10.144.102.48:4444/grid/register -port 5566
Please have this changed to
java -Dwebdriver.edge.driver=C:\MicrosoftWebDriver.exe -jar C:\selenium-server-standalone-3.8.1.jar -role node -hub http://10.144.102.48:4444/grid/register -port 5566
Notice that the role has been specified as just node
and not as node webdriver
(which you have provided)
On a side note, I would encourage you to have the MicrosoftWebDriver.exe
binary available as part of your %PATH%
variable. Its only a one time activity and so it wont need you to keep passing in the path to it via the JVM argument.
来源:https://stackoverflow.com/questions/48097238/exception-was-passed-main-parameter-webdriver-but-no-main-parameter-was-defin