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)
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
Use case ID |
May 25, 2016 |
Use case scenarios |
System Log In |
Use case description |
Administrator login backstage, register user account, registration requirements input: User name, password, mailbox, user name consists of alphanumeric, must start letter, password at least 6, the mailbox must conform to the rules, registration successfully jump to the user login page. |
Use Case Portal |
Open IE, enter the address in the Address bar, enter the Administrator login page |
Test case ID |
Scene |
Test steps |
Forecast results |
Note |
TC1 |
Initial page display |
Enter from the use case entrance |
Page elements complete, display consistent with detailed design |
|
TC2 |
Registration page |
Administrator does not log in |
Unable to register |
Administrator login Required |
TC3 |
Register- Enter user name |
Enter user name 12test |
Hint: User name format is incorrect |
User name must start with a letter |
SCS |
Register- Enter password |
Enter your password 11111 |
Hint: password cannot be less than 6 bits |
Letters at least 6 digits |
Scr |
Registration- Password Confirmation |
is empty |
Hint: the password cannot be empty |
Cannot be empty |
TC6 |
Registration- Email input |
Input 716333 |
Tip: The mailbox format is incorrect |
Non-compliance with mailbox rules |
TC6 |
Register- Enter user |
Input test12 |
Input success |
|
TC7 |
Register- Enter password |
Input test1111 |
Input success |
|
TC8 |
Registration- Email input |
Enter [email protected] |
Input success |
|
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: Automated test login feature implementation
*/
@Test
public void Demo () {
System.setproperty ("Webdriver.firefox.bin", "E:\\program Files\\firefox\\firefox.exe");
Instantiating a Browser object
Webdriver demo = new Firefoxdriver ();
Go to test page
Demo.get ("http://localhost:8080/jsp_jdbc/login.jsp");
Instantiate the object, set the wait time to seconds
webdriverwait wait = new webdriverwait (driver, 100);
Locate the login address and enter the user name UN password for CCJ
Webelement txtsearchbox= demo.findelement (by.name ("un")). SendKeys ("CCJ");
Log in by clicking the login button automatically
Webelement btn = demo.findelement (by.id ("su")). Click ();
Close Browser
Demo.close ();
}
}
"Software Test"--fourth time assignment