"Software Test"--fourth time assignment

Source: Internet
Author: User

1, the background of a company's website management has a user registration function needs to test, the test is a black box test, please use a table to give the function of the test case (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)

Background management user Registration function test case

Use case ID Test Cases Use case name System Login
Use case description Administrator must first log in, enter the site management, access to the background management interface can be user registration; User registration must be carried out: Enter the user name, password, password confirmation, mailbox, these 4 items can not be empty, and the format meets the requirements of the case; After successful registration, prompt registration is successful, and jump to the user login page to log in, and finally enter a registered user to login.
Use Case Portal Open IE, in the Address bar input (http://www.fengt.com/Admin/UserRegister.jsp), into the background to manage the user registration interface, user registration, after the successful registration, automatically jump to the background user login interface, to login.

Test case ID Scene Test steps Expected results Note

TC1

User Registration page Display Enter http://www.fengt.com/Admin/UserRegister.jsp from the use case entrance Access to the management background of the registration interface, the page elements complete, display and detailed design consistent
TC2 User name registration input--authentication Enter a new user name in the User Name entry box: for example [email protected] Enter the correct user name format, in the database does not have the same name match to, the user name is unique, in the User name input box to the right of the display green tick, prove that this user name can be used. User name can be registered
TC3 User name Input format error--fault tolerance verification Enter a new user name in the User Name entry box: 123 or 123JFH or [email protected] or no username, etc. Pop-up Hint: User name requires 6-10 characters, consisting of letters and numbers, and can only start with a letter, automatically jump to step TC2 User name Input format is not correct, the user name is not filled in, and the new user name cannot be requested.
SCS User password input--authentication Enter the new password in the Password entry box: [Email protected] Enter the correct password format and show a green tick on the right side of the password input box to prove that the user name is available. New password can be used
Scr Bad password input format--fault tolerance verification Enter the new password in the Password entry box: 123456 or 1234 or 54DJH

Step out: Password at least 6 bits, including letters, numbers and special symbols such as:! + ~ etc); auto Jump to step TC4

Password input format is incorrect, no new password is required and no new password can be requested.
TC6 Password Confirmation--Verification Enter the password again in the Password confirmation box: [Email protected] A green tick appears on the right side of the password confirmation input box to verify that the password is correct. And the first input is the same as the password
TC7 Password acknowledgement error--fault tolerance verification Enter the password again in the Password confirmation box: [Email protected] Step out of the hint: you enter the password is not the same, please enter the new; auto jump to steps TC6 And the first input is a different password.
TC8 Email input--verification In the Mailbox input box, enter: [Email protected] A green tick appears on the right side of the mailbox input box to prove that the mailbox is properly formatted. Mailboxes can be used
TC9 Mailbox format input Error--fault tolerance verification In the Mailbox input box, enter: 54634545sj.com, etc. Out of the box: you enter the mailbox must comply with the mailbox rules; auto Jump to step TC8 The user is not correctly entering the mailbox format
TC10 User completed, start registration Click the Register button Step out of the prompt: "Registration successful, please remember the password", and directly to the user login interface User Registration Successful
TC11 User skipped user name, password, password confirmation, one or more of the mailboxes, not registered Direct confirmation of submission

Pop-up hint: Show not registered text box can not be empty, please new registration; auto Jump to step TC2

User does not have the username, password, password confirmation, the mailbox is registered complete

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

1. Add ID=SU attribute to login interface

<body>
<form action= "validate.jsp" method= "POST" >
<div align= "center" >
User Login <br>
User name: <input type= "text" name= "username" ><br><br>

Secret &nbsp; code: <input type= "text" name= "password" ><br><br>

<input type= "Submit" value= "Login" id= "su" >
</div>
</form>
</body>

2. Adding test tables and testing cases to MySQL database


Use test;

Create Table User
(
Idint auto_increment NOT NULL,
Username varchar (TEN) is not NULL,
Password varchar (ten) is not NULL,
Primary KEY (ID)
);


Insert into user values (1, ' ccj ', ' CCJ ');
Insert into user values (2, ' admin ', ' admin ');

3. Test 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.support.ui.WebDriverWait;


public class test{

/*

* Description: Use SELENIUM2 to implement functional automated testing for login functions in use case projects

*/


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


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

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

        //Find the User Name entry box and automatically enter the user name
         Webelement Txtsearchbox = demo.findelement (By.name ("un")). SendKeys ("CCJ");
        //Find the Password entry box and automatically enter the password
         Webelement Txtsearchbox = demo.findelement (By.name ("PW")). SendKeys ("CCJ");


Find the Login button and click it automatically
Webelement btn = demo.findelement (by.id ("su")). Click ();

Close browser
Demo.close ();

}


}

"Software Test"--fourth time 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.