繁体   English   中英

Selenium WebDriver-什么是“ Selenium客户端和WebDriver语言绑定”

[英]Selenium WebDriver - What is “Selenium Client & WebDriver Language Bindings”

在selenium下载页面中,我看到了“ Selenium Client和WebDriver语言绑定”部分。

1)什么是语言绑定?

2)什么是客户端驱动程序? (我不是来自技术背景)

有人可以解释一下从硒下载页面获取的以下内容:( http://docs.seleniumhq.org/download/

*

为了创建与Selenium服务器交互的脚本(Selenium RC,Selenium远程Webdriver)或创建本地Selenium WebDriver脚本,您需要使用特定于语言的客户端驱动程序。 这些语言包括1.x和2.x样式的客户端。 虽然存在其他语言的语言绑定,但这些是Google代码上托管的主项目支持的核心绑定。

    *

该文档有些过时了。 它来自旧的Selenium 1.x版本。 Selenium WebDriver现在与2.x版本(最新版本为2.31)大不相同。 Selenium 2.x版本在您的视图中隐藏了绑定。 定义功能并启动新的RemoteWebDriver,然后Hub + Node会在幕后处理绑定。

现在,要类似于RC进行交互,您需要:

  1.  To start a Grid Hub on port 4444
  2.  Start 1 Node Hub on port 5555 on either your local machine or a remote machine.  It has configuration that tells it how to connect to the Hub.
  3.  In your script, start a new client using:

 URL hubURL = new URL("127.0.0.1:4444"); // always use IP address
 DesiredCapabilities capability = DesiredCapabilities.internetExplorer();
 RemoteWebDriver driver = new RemoteWebDriver(new URL(hubURL), capability);

我有一个示例项目,您可以在这里尝试

2)什么是客户端驱动程序?

Selenium使用许多客户端驱动程序java,python ....,因此要使用每种编程语言,都有一个不同的驱动程序。在我的理解中,这不过是一个JAR。

暂无
暂无

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

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