Software Test LAB2

Source: Internet
Author: User

1, this time on the computer test task: The use of webdriver after completion of automated testing

2, this time on the computer experiment Objective: Master Webdriver usage and disposition.

3, this time on the computer experiment content:

Installation of 3.1Selenium:

First we go to Selenium's official website: http://www.seleniumhq.org/to download Selenium. Enter the official website:

  

Then download the Selenium IDE:

  

Click the arrow refers to the URL, enter after the download Firefox plug-ins, and then you can use the Selenium IDE.

Use of the 3.2Selenium IDE:

Open Firefox Browser, click on the top right corner,

  

The selenium interface appears after clicking:

  

If you use it, the basic one is the start recording button:

When you click on record, then you can enter the URL on the page, click the link ... A series of operations that are written down and you can see them.

Then click Close Recording (a button). So you can finish the recording of a motion.

You can click the Green Start button to re-execute the entire action.

The important thing is that you can use the command below to test, the target bar selects select after the page you want to view the part of the click on it, and then compare the values on the page and you set the value of

, you can test it.

Best of all, it can help you generate Java code automatically, you can click "File", "Save test Case as", "Java/junit/webdriver", so you can see the code of your recording action, of course, This code is used in the Webdriver. This is a good way to learn, do not write code, record a paragraph, and then export it well, so that you can learn.

3.3: The main content and completion of the experiment:

3.3.1 This experiment is mainly to read a CSV file, and then read out the inside of the account, password is the account after six bits, and then achieve automatic login. You can see the mailbox information for this account when you log in. The automated test we're going to do is to compare the mailbox information in the CSV with the page above to see if it's consistent.

This test if the person manual operation, need to enter 109 times the account password, and check the mailbox 109 times. With Webdriver and JUnit, automatic logons are possible, and each use case is automatically aligned.

Gossip not much said, on the code, pro-test can run, I use the Chrome browser, because my Firefox and webdriver incompatible:

Code: Https://github.com/yanwenxiong/SoftwareTesting/tree/master/TestSelenium

Just down the whole project, you can. End.

Software Test LAB2

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.