[Zero-based] Selenium: Webdriver introductory tutorial java graphic papers (attached related packages)

A, selenium2.0 brief

  General browser testing framework (crawler frame) different, Selenium2.0 actually consists of two parts Selenium + webdriver, Selenium responsible for interpreting the user's instruction (code), webdriver is responsible for the control and browser page parsing. So when using Selenium2.0 requires a corresponding version of webdriver and browser, the program is running will start a real browser by webdriver. Due to the combination webdriver + browser, Selenium does not exist for js, ajax resolve problems, which directly use the browser to the site code parsing and obtaining the results of web code, so Selenium is the best web automated testing framework, but also the perfect js / ajax page crawlers.

Second, prepare the environment

  Selenium supports several language development, I use here is java.

  1, javaSDK, the latest edition to the compiler using eclipse

  2, Selenium, Version: Selenium-java-3.141 (downloading attached end of the text)

  3, chrome browser, version: chrome-75 (32-bit) supports a variety of browsers, I used chrome (end text attached download)

  3, webdriver, Version: chromedriver-75 (32-bit) number, corresponding to the required browser version (End annexed download)

Third, the installation software

  1, the Selenium-java-3.141 decompression, find the jar file

  There are several in the lib directory

  2, install chrome

  Double-click the installation package chrome automatically installed, but we need to find it in the installation directory, so finding chrome shortcut, right click -> Properties to see its installation path, remember the installation path:

  “C:\Users\ThinkPad\AppData\Local\Google\Chrome\Application\chrome.exe”

  3、chromedriver

  Chromedriver.exe downloaded into the root directory of C to

Fourth, the test project

   1, a new java project

  

  2、右键项目->Properties->Java Build Path->Add External JARs,找到刚才Selenium-java-3.141中的jar文件,点击打开将jar文件引入项目

  不要忘了libs目录中还有

 

Guess you like

Origin www.cnblogs.com/cation/p/11183045.html