Selenium WebDriver 中 DesiredCapabilities 的用途是什么? [英] What is the use of DesiredCapabilities in Selenium WebDriver?

查看:38
本文介绍了Selenium WebDriver 中 DesiredCapabilities 的用途是什么?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

Selenium WebDriver 中 DesiredCapabilities 的用途是什么?

What is the use of DesiredCapabilities in Selenium WebDriver?

我们何时需要使用它以及如何使用?

When we want to use this and how?

示例的答案将不胜感激.

Answer with example would be appreciated.

推荐答案

您应该阅读有关 的文档所需的能力.ChromeDriver 还有一个不同的页面.来自 Capabilities 的 Javadoc:

You should read the documentation about DesiredCapabilities. There is also a different page for the ChromeDriver. Javadoc from Capabilities:

Capabilities:描述了一系列封装浏览器各个方面的键/值对.

Capabilities: Describes a series of key/value pairs that encapsulate aspects of a browser.

基本上,DesiredCapabilities 帮助设置 WebDriver 的属性.如果您的本地安装与默认设置不对应,一个典型的用例是设置 FirefoxDriver 的路径.

Basically, the DesiredCapabilities help to set properties for the WebDriver. A typical usecase would be to set the path for the FirefoxDriver if your local installation doesn't correspond to the default settings.

这篇关于Selenium WebDriver 中 DesiredCapabilities 的用途是什么?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆