A, Selenium basis Introduction and Installation
1, Selenium Introduction
Selenium is a test site for the automated testing tool that supports a variety of browsers including Chrome, Firefox, Safari and other mainstream browser interface, also supports phantomJS no browser interface.
2, installation Selenium
3, install the browser driver
When selenium upgrade to 3.0 for different browsers drives were the norm. If you want to use a different browser selenium drive, you must be downloaded separately and set a different browser driven.
Each browser Download:
Firefox browser driver: geckodriver
Chrome browser driver: chromedriver
IE browser driver: IEDriverServer
Edge Browser drive: MicrosoftWebDriver
Opera browser driver: operadriver
PhantomJS browser driver: PhantomJS
Note: Some browsers need to drive address outside the network. Configure the browser windows driven environment
After the download, unzip ubuntu environment, into / usr / bin
Two, Selenium Getting Started
1, selenium elements positioned usage
If we have a Web page, view the properties of an element is by front-end tools (eg, Firebug).
Our aim is to position the input box input the label.
- By positioning id:
- Positioning by name:
- name located by class:
- By positioning tag name:
- By positioning xpath, positioned xpath N kinds of writing, writing several commonly used are listed here:
- By positioning css, css positioned N kinds of writing, writing several commonly used are listed here:
Next, there is a set of text links on our pages.
- By locating text link:
- By locating text link: