Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Exception "Was passed main parameter 'webdriver' but no main parameter was defined Error while creating note

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

like image 988
Dhrumil Pathak Avatar asked Dec 05 '25 09:12

Dhrumil Pathak


1 Answers

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.

like image 118
Krishnan Mahadevan Avatar answered Dec 06 '25 21:12

Krishnan Mahadevan



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!