"Software Testing"--the Fourth Time blog assignment

Source: Internet
Author: User

1. The background management of a company's website has a user registration function needs to be tested, the test is black box test, please give the test case of the function in the form of table (refer to the Textbook P107 page). The user registration function is described as follows:

(1) The administrator must first log in, to enter the site management, access to the background management interface can be user registration (assuming that the user registered URL address is http://www.fengt.com/Admin/UserRegister.jsp)

(2) User registration requirements to enter the user name, password, password confirmation, mailbox, these 4 items can not be empty

(3) The user name requires 6-10 characters, consisting of letters and numbers, and can only begin with a letter. The user name is unique.

(4) Password at least 6 digits, including letters, numbers and special symbols (such as:!) + ~ etc)

(5) The mailbox must comply with the mailbox rules

(6) Any requirement above the law should have a corresponding prompt

(7) Registration success must prompt "registration success, please remember password" and jump to the user login page to sign in (assuming the user login page is http://www.fengt.com/Admin/Login.jsp)

/*

* Completed by: Best loss Friend

*/

Test case ID

Scene

Test steps

Expected results

TC1

Admin Login

Enter the landing page to log in

Show Admin Login Successful

TC2

Go to the Admin interface,

Login for user registration.

Select User Registration module for user registration, browser address http://www.fengt.com/Admin/UserRegister.jsp

Successfully entered the registration module

TC3

User name Verification

Enter a id:test that already exists

Prompt user already exists, re-enter

SCS

User name Tolerance Verification

Input: 1111111111111111111111111111111111

Prompt input length exceeds specified range

TC5

Password verification

Enter the user name for the specification and enter a compliance

Fan's password: 123456

Prompted to enter a password that does not conform to the specification, please re-check the input.

TC6

Password Confirmation--validity check

Enter a valid user name and enter the canonical password for the first time:

wu123! , enter invalid password for the second time: 123456

Prompted to enter the two times the password is not the same, please re-enter

Scp

Mailbox Input Validation

Enter a non-compliant mailbox format: [email protected]

Prompt to enter the mailbox format is incorrect, please re-enter

TC8

Correct input

Enter user name: Xiaoxiao Password: wu123! Confirm Password: wu123! Email:[email protected], click Submit

Prompt input correct, registration successful, and prompt "registration successful, please remember password"

TC9

Registration successful

Page Jump

Jump into landing page

2, the use of Selenium2 for the LAB05 project login function to achieve functional automation testing.

Note

L Design test Cases should consider the success of the login and unsuccessful two situations;

L LAB05 Project for the experiment 5 to use the project, in everyone's class QQ group, the database using MySQL, database files in the project root directory CreateDataBase.txt

Step one: Give experiment 5 the original login page form code plus ID attribute

<body>
<form action= "validate.jsp" method= "POST" >
<div align= "center" >
User Login <br>
User name: <input id= "un" type= "text" name= "username" ><br><br>
Password: <input id= "PW" type= "text" name= "password" ><br><br>
<input type= "Submit" id= "SM" value= "Login" >
</div>
</form>
</body>

Step Two: Add your own account data to the database

ALTER TABLE user;

Insert into user values (3, ' Wujie ', ' 023 ');

Step Three: Test program code

Import Org.junit.Test;
Import Org.openqa.selenium.By;
Import Org.openqa.selenium.WebDriver;
Import org.openqa.selenium.WebElement;
Import Org.openqa.selenium.firefox.FirefoxDriver;
Import Org.openqa.selenium.ie.InternetExplorerDriver;
Import org.openqa.selenium.support.ui.WebDriverWait;


public class seleniumtest{

/*

* Function: Use SELENIUM2 to implement function automation test for login function in LAB05 project

*/


     @Test
    public void Demo () {
        
        system.setproperty ("Webdriver.firefox.bin", "D:\\Program files\\fire\\ Firefox.exe ");
  
        //open Firefox
         Webdriver Demo = new Firefoxdriver ();


        //Open the page you want to test
        Demo.get ("http://localhost : 8080/lab05/login.jsp ");

        //Setting the wait time exceeded (100 seconds)
        webdriverwait wait = new webdriverwait (driver, 100);

        //find the Username entry box with the ID of UN and automatically enter the user name
         Webelement Txtsearchbox = demo.findelement (By.name ("un")). SendKeys ("Wujie");
        //Find the Password entry box, ID is PW, and automatically enter the password
         Webelement Txtsearchbox = demo.findelement (By.name ("PW")). SendKeys ("023456");


Locate the login button, ID is SM, and click it automatically
Webelement btn = demo.findelement (by.id ("su")). Click ();

Close browser
Demo.close ();

}


}

"Software Testing"--the Fourth Time blog assignment

Related Article

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.