一、 实验目的
应用Web测试工具对Web系统进行功能和性能测试;
二、实验要求
1. 撰写实验报告;
2. 撰写Web系统的测试计划,测试方案;
3. 撰写Web系统测试的测试用例;
4. 撰写缺陷报告;
5. 提交测试脚本。
三、实验内容
1.题目一:测试网站功能
选择一个网站,对其进行功能测试。要求首先编写测试用例,然后在mooctest平台对该网站进行测试。
2.题目二:测试网站性能
选择一个网站,对其进行性能测试。要求在mooctest平台进行负载测试。
四、测试用例的编写
1.功能测试用例设计
1)用例名称:房屋租赁系统
2)前置条件:
(a)用户已成功登录系统;
3)测试步骤:
4)预期结果:完成操作
测试步骤
Selenium 脚本录制
导出Junit测试
完善脚本
// Generated by Selenium IDE
import org.junit.Test;
import org.junit.Before;
import org.junit.After;
import static org.junit.Assert.*;
import static org.hamcrest.CoreMatchers.is;
import static org.hamcrest.core.IsNot.not;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.openqa.selenium.remote.RemoteWebDriver;
import org.openqa.selenium.remote.DesiredCapabilities;
import org.openqa.selenium.Dimension;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.interactions.Actions;
import org.openqa.selenium.support.ui.ExpectedConditions;
import org.openqa.selenium.support.ui.WebDriverWait;
import org.openqa.selenium.JavascriptExecutor;
import org.openqa.selenium.Alert;
import org.openqa.selenium.Keys;
import java.util.*;
import java.net.MalformedURLException;
import java.net.URL;
public class Zhouri1Test {
private WebDriver driver;
private Map<String, Object> vars;
JavascriptExecutor js;
@Before
public void setUp() {
driver = new ChromeDriver();
js = (JavascriptExecutor) driver;
vars = new HashMap<String, Object>();
}
@After
public void tearDown() {
driver.quit();
}
@Test
public void zhouri1() {
driver.get("http://114.215.176.95:60513/text2/"