简体   繁体   中英

Selenium WebDriver - What is “Selenium Client & WebDriver Language Bindings”

In the selenium download page, I see a section "Selenium Client & WebDriver Language Bindings"

1) What is a Language Binding? and

2) What is a Client Driver? (I am not from from a technical background)

Can someone please explain the following taken from selenium download page :( http://docs.seleniumhq.org/download/ )

*

In order to create scripts that interact with the Selenium Server (Selenium RC, Selenium Remote Webdriver) or create local Selenium WebDriver script you need to make use of language-specific client drivers. These languages include both 1.x and 2.x style clients. While language bindings for other languages exist, these are the core ones that are supported by the main project hosted on google code.

    *

Some of that documentation is old. It comes from the old Selenium 1.x versions. Selenium WebDriver is much different now, with 2.x versions (the latest being 2.31). Selenium 2.x versions have bindings hidden from your view. You define capabilities and start a new RemoteWebDriver and the Hub+Node handles the binding under the covers.

Now, to interact similar to RC you need:

  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);

I have an example project you can try here .

2) What is a Client Driver?

Selenium uses many client drivers java,python.... so to work with each programming language there is a different driver.This is nothing but a JAR in my understanding.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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