Get the App
SLTechnology News&Howtos  ›  Internet Technology  › 

Selenium (2)-- webdriver starts

Shulou Source: shulou.com Published: 2022-06-03 04:59:10 11月25日 Update

A brief introduction to Webdriver

The main new feature of Selenium 2.0 is the integration of webdriver API. Webdriver is designed not only to address some of the limitations of selenium RC API, but also to provide a simpler and concise programming interface. It provides better support for dynamic web pages.

Selenium RC adopts the same drive mode for every browser it supports. First, the client of Selenium RC establishes contact with the server, and then the server starts a browser. When the browser is loaded, it inserts javascript and is driven by javascript. Webdriver takes a completely different approach. Instead of using javascript to drive the browser, it invokes the browser directly, and the browser uses its own support for automation to work.

II. Environmental deployment

1. Download and install eclipse and jdk

two。 Download selenium-java-2.32.0 from http://seleniumhq.org/download/ and import the downloaded jar package selenium-java-2.32.0.jar in the project established by eclipse. If you only import this package and report an error at run time, then decompress the downloaded zip file directly and import all the packages in libs.

Click Help- > Install new software-> click Add in the configuration TestNG,Eclipse in 3.eclipse (figure below), and then next all the time. Restart eclipse after installation.

4. Right-click on the new Java project created by eclipse-> build path- > configure build path- > Libraries, and add testNG's jar package testng-6.8.1.jar.

Once this is done, we can use selenium webdriver+testNG to write our test code for testing.

Tags: Browser browser support driver way time server service test different concise lieutenant general code dynamic client client that is interface file environment Apple Docker Huawei Linux macOS MariaDB Microsoft MySQL NVidia OPPO Reno Shulou Tech Info Apple Redmi NVidia Huawei