0

I would like to know what is -D in -Dwebdriver.chrome.driver i've seen in many programs. what is -D denotes.

please help me what is -D means and where can we use

Jakeer
  • 13
  • 2

2 Answers2

2

-Dwebdriver.chrome.driver option is a way to set the ChromeDriver Path in order for it to be used by the program.

Without setting the path u can't use Chrome with the selenium api. (Chrome driver allows u the control over the browser)

E.x usage:

java -Dwebdriver.chrome.driver="Path" ....
RRIL97
  • 858
  • 4
  • 9
0

System Properties

A program can use the System Properties objects to maintain its configuration throughout it's lifespan. Selenium's client itself uses the Properties object to maintain its own configuration. The System class maintains a Properties object that describes the configuration of the current working environment. System properties include information about the current user, the current version of the Java runtime, and the character used to separate components of a file path name.

While working with Selenium we extensively use the System Property webdriver.chrome.driver.

You can find a detailed discussion in How to initiate multiple versions of Geckodriver through System.setProperty()


-Dwebdriver.chrome.driver

As per the documentation in Configuration of Node with options the -D flag is used on the command line to pass the JVM properties which can be picked up and propagated to the nodes.

An example:

-Dwebdriver.chrome.driver=chromedriver.exe
undetected Selenium
  • 183,867
  • 41
  • 278
  • 352