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)
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 |
Forecast results |
TC1 |
Initial page display |
Enter 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 Input--authentication |
Enter non-existent user: test123 |
Input succeeded without jumping out of error prompt |
TC3 |
User name input--Fault tolerance verification |
and enter user name: Test1, TESTABC, 1234567, 123test, test123456789 |
Pop-up Tip: User name requires 6-10 characters, consisting of letters and numbers, and can only start with a letter |
TC4 |
Password Input--authentication |
Enter Password: password123! |
Input succeeded without jumping out of error prompt |
TC5 |
Password input--fault tolerance verification |
Enter Password: pa1! , password, 123456, +++!!! , Password1, password! , 12345! |
Step out: Password at least 6 bits, including letters, numbers and special symbols such as:! + ~ etc) |
TC6 |
Password confirm Input--Verify |
Enter Password: password123! |
Input succeeded without jumping out of error prompt |
TC7 |
Password acknowledgement input--fault tolerance verification |
Enter Password: pass123! |
Jump prompt: Do not match the previous password, please re-enter |
TC8 |
Email input--verification |
Enter Email: [Email protected] |
Input succeeded without jumping out of error prompt |
TC9 |
Mailbox input-fault-tolerant authentication |
Enter e-mail: test123qq.com |
Out of the box: The mailbox you entered must comply with the mailbox rules |
TC10 |
System Registration--success |
TC2,TC4,TC6,TC8, Standalone registration button |
System Registration Successful |
TC11 |
System Registration-user name, password, password confirmation, mailbox check |
No user name, password, password confirmation, mailbox |
System registration failed, prompt: Please enter the user name, password, password confirmation, mailbox |
TC12 |
System Registration--the user's famous school inspection |
No user name entered |
System registration failed, prompt: Please enter user name |
TC13 |
System Registration--Password check |
No password entered |
System registration failed, prompt: Please enter the password |
TC14 |
System Registration--Password confirmation check |
No password confirmation is entered |
System registration failed, prompt: Please enter the password confirmation |
TC15 |
System Registration--Mailbox Check |
No mailbox entered |
System registration failed, prompt: Please enter the mailbox |
TC16 |
System Registration-User name input validity check |
Enter the existing user name, enter a password, password, password confirmation, mailbox |
System registration failed with prompt: The user name already exists |
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 to login interface
<body>
<form action= "validate.jsp" method= "POST" >
<divalign= "Center" >
User Login <br>
User name: <inputtype= "text" name= "username" ><br><br>
Password: <inputtype= "text" name= "password" ><br><br>
<inputtype= "Submit" value= " log in to "id=" su ">
</div>
</form>
</body>
2. Adding test tables and testing cases to MySQL database
Use test;
CreateTable user
(
ID int 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
Importorg.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{
Publicvoid Demo () {
System.setproperty ("Webdriver.firefox.bin", "F:\\firefox\\firefox.exe");
Webdriver demo = Newfirefoxdriver ();
Demo.get ("http://localhost:8080/jsp_jdbc/login.jsp");
webdriverwait wait = newwebdriverwait (driver, 100);
Webelement Txtsearchbox =demo.findelement (by.name ("un")). SendKeys ("CCJ");
Webelement Txtsearchbox =demo.findelement (by.name ("PW")). SendKeys ("CCJ");
Webelement btn = demo.findelement (by.id ("su")). Click ();
Demo.close ();
}
}
Fourth time assignment