Objective
The environment has been set up in the front, which begins with the formal learning of Selenium's webdriver framework. We usually say selenium automation, in fact, it is not similar to QTP and other GUI-like visualization tools, we want to learn is the Webdriver framework of the API.
This article mainly talk about how to call Webdriver Framework API with Java, do some regular operation to the browser, such as open, forward, backward, refresh, set window size, screenshot, exit and so on.
1. Open the website
See the previous section.
2. Get the current page URL
3. Get the current page source code
4. Refresh the current page
5. Set the browser window size
6. Get the browser window size
7. Set browser window coordinates
8. Get browser window coordinates
9. Maximize the browser window
10. Get the browser page Title property
11. Simulate Browser forward function
12, simulation browser back function
13, the current browser window screenshot
14. Exit the browser
1. There are two ways to exit, one is close; the other is quit.
2.close is used to close the current window, and when more windows are open, you can close some windows with close
3.quit to end a process, close all windows
4. End the test with quit. Quit can reclaim temporary files from C drive
"Selenium2+java Automation (3)"-the basic method of operation browsing