"Selenium2+java Automation (3)"-the basic method of operation browsing

Source: Internet
Author: User

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

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.