How to run selenium 3.x with chrome driver via terminal

Maybe this is a simple question, but I can not find information about this.

I used selenium 2.x this way. I start the server:

java -jar selenium-server-standalone-2.53.1.jar -Dwebdriver.chrome.driver=chromedriver -browserSideLog -debug -timeout 60 

And then I run my tests. I use Dart, so I do

 pub run test test/selenium/custom_component_test.dart 

But now I'm trying to use selenium 3. I downloaded it and replaced my old terminal with a new jar, but it looks like I can do it. Selenium tells me that he does not know such a parameter "-Dwebdriver.chrome.driver". And in the help I do not see the parameters to indicate the parameter.

So how to run selenium 3 with chrome driver?

+5
source share
1 answer

Your options are out of order. -D... is the Java time variable. it should appear before the -jar directive.

Change your team to

 java -Dwebdriver.chrome.driver=chromedriver -jar selenium-server-standalone-2.53.1.jar -browserSideLog -debug -timeout 60 

I used to run selenium 2.x this way.

Yes, we changed the source code to use JCommander in 3.0 to analyze the parameters passed to the bank. The -D directives are now parsed as parameters that you are trying to pass to the bank, just like -debug and -timeout . For your team to be well-formed, you really have to use -D... before the -jar directive.

+12
source

Source: https://habr.com/ru/post/1258825/


All Articles