简体   繁体   English

-D 在 -Dwebdriver.chrome.driver 中是什么意思

[英]what does -D means in -Dwebdriver.chrome.driver

I would like to know what is -D in -Dwebdriver.chrome.driver i've seen in many programs.我想知道我在许多程序中看到的 -Dwebdriver.chrome.driver 中的 -D 是什么。 what is -D denotes. -D 是什么意思。

please help me what is -D means and where can we use请帮我什么是 -D 意味着我们可以在哪里使用

-Dwebdriver.chrome.driver option is a way to set the ChromeDriver Path in order for it to be used by the program. -Dwebdriver.chrome.driver 选项是一种设置ChromeDriver 路径以便程序使用它的方法。

Without setting the path u can't use Chrome with the selenium api.如果不设置路径,您将无法将 Chrome 与 selenium api 一起使用。 (Chrome driver allows u the control over the browser) (Chrome 驱动程序允许您控制浏览器)

Ex usage:前用法:

java -Dwebdriver.chrome.driver="Path" ....

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. Selenium客户端本身使用Properties对象来维护自己的配置。 The System class maintains a Properties object that describes the configuration of the current working environment. System类维护一个Properties对象,该对象描述当前工作环境的配置。 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.系统属性包括有关当前用户、Java 运行时的当前版本以及用于分隔文件路径名组成部分的字符的信息。

While working with Selenium we extensively use the System Property webdriver.chrome.driver .在使用Selenium 时,我们广泛使用系统属性webdriver.chrome.driver

You can find a detailed discussion in How to initiate multiple versions of Geckodriver through System.setProperty()您可以在如何通过 System.setProperty() 启动多个版本的 Geckodriver 中找到详细讨论


-Dwebdriver.chrome.driver -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.根据带有选项节点配置中的文档,在命令行上使用-D标志来传递可以拾取并传播到节点的JVM属性。

An example:一个例子:

-Dwebdriver.chrome.driver=chromedriver.exe

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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