提交 2896f471 authored 作者: 黄承天's avatar 黄承天

[feature]

增加静默模式选择 增加统计数据接口 [fix] open的url缺失时将上级url补充机制 点击action机制 双击action机制 未识别类型的command步骤返回结果由null变为一个带信息的错误结果
上级 95265659
// 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 UntitledTest {
private WebDriver driver;
private Map<String, Object> vars;
JavascriptExecutor js;
@Before
public void setUp() {
driver = new FirefoxDriver();
js = (JavascriptExecutor) driver;
vars = new HashMap<String, Object>();
}
@After
public void tearDown() {
driver.quit();
}
public String waitForWindow(int timeout) {
try {
Thread.sleep(timeout);
} catch (InterruptedException e) {
e.printStackTrace();
}
Set<String> whNow = driver.getWindowHandles();
Set<String> whThen = (Set<String>) vars.get("window_handles");
if (whNow.size() > whThen.size()) {
whNow.removeAll(whThen);
}
return whNow.iterator().next();
}
@Test
public void untitled() {
driver.get("https://www.txdx.gov.cn/");
driver.manage().window().setSize(new Dimension(1536, 784));
driver.findElement(By.id("type")).click();
{
WebElement dropdown = driver.findElement(By.id("type"));
dropdown.findElement(By.xpath("//option[. = '全文']")).click();
}
driver.findElement(By.cssSelector("#type > option:nth-child(2)")).click();
driver.findElement(By.id("keyword")).click();
driver.findElement(By.id("keyword")).sendKeys("123");
driver.findElement(By.id("search")).click();
driver.findElement(By.linkText("学校概况")).click();
driver.findElement(By.linkText("首页")).click();
vars.put("window_handles", driver.getWindowHandles());
driver.findElement(By.name("d2")).click();
vars.put("win5003", waitForWindow(2000));
{
WebElement dropdown = driver.findElement(By.name("d2"));
dropdown.findElement(By.xpath("//option[. = '平湖市委党校']")).click();
}
driver.findElement(By.cssSelector("select:nth-child(1) > option:nth-child(6)")).click();
vars.put("root", driver.getWindowHandle());
driver.switchTo().window(vars.get("win5003").toString());
driver.close();
driver.switchTo().window(vars.get("root").toString());
driver.close();
}
}
This source diff could not be displayed because it is too large. You can view the blob instead.
......@@ -26,6 +26,8 @@ public interface CommandType {
String CLICK = "click";
String DOUBLE_CLICK = "doubleClick";
String CLOSE = "close";
}
......@@ -89,6 +89,7 @@ public class ProjectController {
ProjectVo origin = projectService.findById(id);
if (nonNull(origin)) {
if (nonNull(side)) {
String url = side.getUrl();
List<TestCase> tests = side.getTests().stream()
.map(test -> new TestCase().setName(test.getName()).setCommands(test.getCommands()))
.collect(Collectors.toList());
......@@ -96,6 +97,7 @@ public class ProjectController {
.setId(id)
.setName(origin.getName())
.setOs(System.getProperty("os.name"))
.setUrl(url)
.setTests(tests);
projectService.save(project);
ProjectVo after = projectService.findById(id);
......
package com.zjty.autotest.controller;
import com.google.common.collect.ImmutableMap;
import com.zjty.autotest.pojo.vo.Statistics;
import com.zjty.autotest.pojo.vo.report.Report;
import com.zjty.autotest.pojo.vo.report.ReportVo;
import com.zjty.autotest.service.ReportService;
import com.zjty.autotest.service.helper.TransHelper;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.beans.factory.annotation.Autowired;
......@@ -11,6 +14,7 @@ import org.springframework.web.bind.annotation.*;
import springfox.documentation.annotations.ApiIgnore;
import java.util.List;
import java.util.stream.Collectors;
@CrossOrigin
@RestController
......@@ -20,6 +24,9 @@ public class ReportController {
@Autowired
private ReportService reportService;
@Autowired
private TransHelper transHelper;
@ApiIgnore
@ApiOperation(value = "查询所有测试报告")
......@@ -49,4 +56,16 @@ public class ReportController {
return ResponseEntity.ok(ImmutableMap.of("message", "操作成功"));
}
@ApiOperation(value = "根据测试报告 得出统计结果", notes = "请求数据传一组测试报告id")
@PostMapping("/statistics")
public ResponseEntity<Statistics> statistics(@RequestBody List<Integer> ids) {
List<ReportVo> reports = reportService.findByIds(ids).stream()
.map(transHelper::reportDo)
.map(transHelper::reportVo)
.collect(Collectors.toList());
Statistics statistics = reportService.statistics(reports);
return ResponseEntity.ok(statistics);
}
}
......@@ -33,16 +33,6 @@ public class TestController {
@Autowired
private ReportService reportService;
@ApiIgnore
@ApiOperation(value = "保存单个测试用例", notes = "不附带id则为新增 附带id则为更新")
@PostMapping
public ResponseEntity save(@RequestBody TestCase testCase) {
testCaseService.save(testCase);
return ResponseEntity.ok(ImmutableMap.of("message", "操作成功"));
}
@ApiIgnore
@ApiOperation(value = "查询所有测试用例")
@GetMapping
......
package com.zjty.autotest.pojo.dbo.project;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
......
package com.zjty.autotest.pojo.vo;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
@Data
@AllArgsConstructor
@NoArgsConstructor
public class Statistics {
@ApiModelProperty(value = "步骤总数", example = "100", position = 1)
private Integer total;
@ApiModelProperty(value = "已测试步骤数", example = "98", position = 2)
private Integer finished;
@ApiModelProperty(value = "未测试步骤数", example = "2", position = 3)
private Integer unfinished;
@ApiModelProperty(value = "已测试步骤中成功的步骤数", example = "90", position = 4)
private Integer successes;
@ApiModelProperty(value = "已测试步骤中失败的步骤数", example = "8", position = 5)
private Integer failures;
@ApiModelProperty(value = "步骤平均耗费时间", example = "100", position = 6)
private Long averageCostTime;
@ApiModelProperty(value = "耗费时间小于2的步骤数", example = "80", position = 7)
private Integer littleThan2s;
@ApiModelProperty(value = "耗费时间在2到3之间的步骤数", example = "10", position = 8)
private Integer between2sAnd3s;
@ApiModelProperty(value = "耗费时间大于3的步骤数", example = "10", position = 9)
private Integer greaterThan3s;
}
......@@ -30,7 +30,11 @@ public class Project {
private String os;
@JsonIgnore
@ApiModelProperty(value = "测试用例数据", position = 5)
@ApiModelProperty(value = "url", example = "http://www.baidu.com", position = 5)
private String url;
@JsonIgnore
@ApiModelProperty(value = "测试用例数据", position = 6)
private List<TestCase> tests;
}
......@@ -12,10 +12,13 @@ import java.util.List;
@NoArgsConstructor
public class Side {
@ApiModelProperty(value = "项目名", example = "test", position = 2)
@ApiModelProperty(value = "项目名", example = "test", position = 1)
private String name;
@ApiModelProperty(value = "测试用例数据", position = 5)
@ApiModelProperty(value = "url", example = "test", position = 2)
private String url;
@ApiModelProperty(value = "测试用例数据", position = 3)
private List<Test> tests;
}
package com.zjty.autotest.service;
import com.zjty.autotest.pojo.dbo.project.TestCaseDo;
import com.zjty.autotest.pojo.vo.project.Project;
import com.zjty.autotest.pojo.dbo.project.ProjectDo;
import com.zjty.autotest.pojo.vo.project.ProjectVo;
import com.zjty.autotest.pojo.vo.project.TestCase;
import com.zjty.autotest.repository.ProjectRepository;
import com.zjty.autotest.repository.ReportRepository;
import com.zjty.autotest.repository.TestCaseRepository;
import com.zjty.autotest.service.helper.TransHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
......@@ -28,38 +26,29 @@ public class ProjectService {
@Autowired
private ProjectRepository projectRepository;
@Autowired
private TestCaseRepository testCaseRepository;
@Autowired
private ReportRepository reportRepository;
@Autowired
private TransHelper transHelper;
private String os = System.getProperty("os.name");
@Autowired
private TestCaseService testCaseService;
@SuppressWarnings("Duplicates")
public void save(Project project) {
String url = project.getUrl();
ProjectDo projectDo = transHelper.projectDo(project);
Integer projectDoId = projectRepository.save(projectDo).getId();
if (isNull(project.getId())) {
List<TestCase> tests = project.getTests();
if (nonNull(tests)) {
List<TestCaseDo> tests4save = tests.stream()
.map(transHelper::testCaseDo)
.map(testCaseDo -> testCaseDo.setProjectId(projectDoId))
.collect(Collectors.toList());
testCaseRepository.saveAll(tests4save);
tests.forEach(testCase -> testCaseService.save(testCase, projectDoId, url));
}
} else {
Integer projectId = project.getId();
testCaseRepository.deleteAllByProjectId(projectId);
testCaseService.deleteAllByProjectId(projectId);
reportRepository.deleteAllByProjectId(projectId);
List<TestCase> tests = project.getTests();
if (nonNull(tests)) {
List<TestCaseDo> tests4save = tests.stream()
.map(transHelper::testCaseDo)
.map(testCaseDo -> testCaseDo.setProjectId(projectId))
.collect(Collectors.toList());
testCaseRepository.saveAll(tests4save);
tests.forEach(testCase -> testCaseService.save(testCase, projectId, url));
}
}
}
......
package com.zjty.autotest.service;
import com.zjty.autotest.pojo.vo.Statistics;
import com.zjty.autotest.pojo.vo.report.Report;
import com.zjty.autotest.pojo.dbo.report.ReportDo;
import com.zjty.autotest.pojo.vo.report.ReportVo;
import com.zjty.autotest.pojo.vo.report.Step;
import com.zjty.autotest.repository.ReportRepository;
import com.zjty.autotest.service.helper.TransHelper;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.PageRequest;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;
......@@ -16,7 +17,6 @@ import java.util.List;
import java.util.stream.Collectors;
import static java.lang.String.format;
import static java.util.Objects.nonNull;
@Service
public class ReportService {
......@@ -31,7 +31,6 @@ public class ReportService {
reportRepository.save(reportDo);
}
public List<Report> findAll() {
return reportRepository.findAll().stream()
.sorted(Comparator.comparing(ReportDo::getEndTime))
......@@ -46,6 +45,13 @@ public class ReportService {
.collect(Collectors.toList());
}
public List<Report> findByIds(List<Integer> ids) {
return reportRepository.findAllById(ids).stream()
.sorted(Comparator.comparing(ReportDo::getEndTime))
.map(transHelper::report)
.collect(Collectors.toList());
}
public List<Report> findByTestId(Integer testId) {
return reportRepository.findAllByProjectId(testId).stream()
.map(transHelper::report)
......@@ -70,4 +76,74 @@ public class ReportService {
}
}
public Statistics statistics(List<ReportVo> reports) {
Integer total = reports.stream()
.map(ReportVo::getTotal)
.reduce(Integer::sum)
.orElse(-1);
Integer finished = reports.stream()
.map(ReportVo::getFinished)
.reduce(Integer::sum)
.orElse(-1);
int unfinished = total - finished;
Integer successes = reports.stream()
.map(ReportVo::getSuccesses)
.reduce(Integer::sum)
.orElse(-1);
Integer failures = reports.stream()
.map(ReportVo::getFailures)
.reduce(Integer::sum)
.orElse(-1);
Long totalCostTime = reports.stream()
.flatMap(report -> report.getSteps().stream())
.map(Step::getCostTime)
.reduce(Long::sum)
.orElse(-1L);
long averageCostTime = totalCostTime / total;
Integer litterThan1s = reports.stream()
.map(this::getLittlerThan1s)
.reduce(Integer::sum)
.orElse(-1);
Integer between2sAnd3s = reports.stream()
.map(this::getBetween2sAnd3s)
.reduce(Integer::sum)
.orElse(-1);
Integer greaterThan3s = reports.stream()
.map(this::getGreaterThan3s)
.reduce(Integer::sum)
.orElse(-1);
return new Statistics(
total,
finished,
unfinished,
successes,
failures,
averageCostTime,
litterThan1s,
between2sAnd3s,
greaterThan3s
);
}
private Integer getLittlerThan1s(ReportVo report) {
long count = report.getSteps().stream()
.map(step -> step.getCostTime() < 1000)
.count();
return Math.toIntExact(count);
}
private Integer getBetween2sAnd3s(ReportVo report) {
long count = report.getSteps().stream()
.map(step -> step.getCostTime() >= 2000 && step.getCostTime() <= 3000)
.count();
return Math.toIntExact(count);
}
private Integer getGreaterThan3s(ReportVo report) {
long count = report.getSteps().stream()
.map(step -> step.getCostTime() > 3000)
.count();
return Math.toIntExact(count);
}
}
......@@ -108,8 +108,8 @@ public class SeleniumExecutor {
sendWebSocket(report);
}
} catch (Exception e) {
log.error("出现错误");
e.printStackTrace();
log.error(e.getLocalizedMessage());
Arrays.stream(e.getStackTrace()).forEach(System.out::println);
}
try {
driver.quit();
......@@ -140,7 +140,8 @@ public class SeleniumExecutor {
String content = null;
String message = null;
String screenShot = null;
Long stepStartTime = System.currentTimeMillis();
long costTime;
long stepStartTime = System.currentTimeMillis();
boolean success;
try {
//根据操作类型模拟浏览器操作 并判断错误
......@@ -150,21 +151,24 @@ public class SeleniumExecutor {
Boolean connectAble = seleniumHelper.checkConnect(target);
if (connectAble) {
driver.get(target);
seleniumHelper.setHistoryHandles(driver.getWindowHandles());
costTime = System.currentTimeMillis() - stepStartTime;
success = true;
} else {
message = "无响应的地址";
costTime = System.currentTimeMillis() - stepStartTime;
success = false;
}
break;
case SET_WINDOW_SIZE:
content = format("设置窗口尺寸:[%s]", target);
driver.manage().window().setSize(seleniumHelper.dimension(target));
costTime = System.currentTimeMillis() - stepStartTime;
success = true;
break;
case STORE_WINDOW_HANDLE:
content = format("保存窗口句柄:[%s]", target);
seleniumHelper.getHandleMap().put(target, driver.getWindowHandle());
costTime = System.currentTimeMillis() - stepStartTime;
success = true;
break;
case SELECT_WINDOW:
......@@ -174,13 +178,16 @@ public class SeleniumExecutor {
if (nonNull(handle)) {
try {
driver.switchTo().window(handle);
costTime = System.currentTimeMillis() - stepStartTime;
success = true;
} catch (Exception e) {
message = format("窗口失效:[%s]", handleName);
costTime = System.currentTimeMillis() - stepStartTime;
success = false;
}
} else {
message = format("未知句柄:[%s]", handleName);
costTime = System.currentTimeMillis() - stepStartTime;
success = false;
}
break;
......@@ -192,22 +199,50 @@ public class SeleniumExecutor {
} else {
driver.switchTo().frame(Integer.valueOf(index));
}
costTime = System.currentTimeMillis() - stepStartTime;
success = true;
break;
case CLICK:
content = format("点击元素:[%s]", target);
element = getElement(targets);
if (nonNull(element)) {
element.click();
seleniumHelper.waitSomeTime();
//如果该点击打开了新标签页 则通过对比当前与历史找出新的标签页句柄并存入Map
if (nonNull(command.getOpensWindow()) && command.getOpensWindow()) {
boolean newWindow = nonNull(command.getOpensWindow()) && command.getOpensWindow();
if (newWindow) {
seleniumHelper.setHistoryHandles(driver.getWindowHandles());
}
new Actions(driver).moveToElement(element).click().perform();
seleniumHelper.waitSomeTime();
costTime = System.currentTimeMillis() - stepStartTime;
success = true;
if (newWindow) {
seleniumHelper.getHandleMap().put(command.getWindowHandleName(), getWindowHandle());
}
seleniumHelper.setHistoryHandles(driver.getWindowHandles());
} else {
message = "无法定位该元素";
costTime = System.currentTimeMillis() - stepStartTime;
success = false;
}
break;
case DOUBLE_CLICK:
content = format("双击元素:[%s]", target);
element = getElement(targets);
if (nonNull(element)) {
//如果该双击打开了新标签页 则通过对比当前与历史找出新的标签页句柄并存入Map
boolean newWindow = nonNull(command.getOpensWindow()) && command.getOpensWindow();
if (newWindow) {
seleniumHelper.setHistoryHandles(driver.getWindowHandles());
}
new Actions(driver).moveToElement(element).doubleClick().perform();
seleniumHelper.waitSomeTime();
costTime = System.currentTimeMillis() - stepStartTime;
success = true;
if (newWindow) {
seleniumHelper.getHandleMap().put(command.getWindowHandleName(), getWindowHandle());
}
} else {
message = "无法定位该元素";
costTime = System.currentTimeMillis() - stepStartTime;
success = false;
}
break;
......@@ -217,10 +252,12 @@ public class SeleniumExecutor {
element = locateElement(target);
if (nonNull(element)) {
element.findElement(By.xpath(format("//option[. = '%s']", label))).click();
seleniumHelper.waitSomeTime();
costTime = System.currentTimeMillis() - stepStartTime;
success = true;
seleniumHelper.waitSomeTime();
} else {
message = "无法定位该元素";
costTime = System.currentTimeMillis() - stepStartTime;
success = false;
}
break;
......@@ -229,10 +266,12 @@ public class SeleniumExecutor {
content = format("鼠标悬停:[%s]", target);
if (nonNull(element)) {
new Actions(driver).moveToElement(element).perform();
seleniumHelper.waitSomeTime();
costTime = System.currentTimeMillis() - stepStartTime;
success = true;
seleniumHelper.waitSomeTime();
} else {
message = "无法定位该元素";
costTime = System.currentTimeMillis() - stepStartTime;
success = false;
}
break;
......@@ -240,12 +279,17 @@ public class SeleniumExecutor {
element = getElement(targets);
content = format("输入内容:[%s]", value);
if (nonNull(element)) {
element.clear();
String elementType = element.getAttribute("type");
if (!Objects.equals(elementType, "file")) {
element.clear();
}
element.sendKeys(value);
seleniumHelper.waitSomeTime();
costTime = System.currentTimeMillis() - stepStartTime;
success = true;
seleniumHelper.waitSomeTime();
} else {
message = "无法定位该元素";
costTime = System.currentTimeMillis() - stepStartTime;
success = false;
}
break;
......@@ -256,14 +300,21 @@ public class SeleniumExecutor {
} catch (Exception e) {
log.error(e.getClass().getSimpleName());
}
costTime = System.currentTimeMillis() - stepStartTime;
success = true;
break;
default:
return null;
return new Step()
.setSuccess(false)
.setCostTime(-1L)
.setContent("无")
.setMessage("未识别的Command类型");
}
} catch (Exception e) {
e.printStackTrace();
log.error(e.getLocalizedMessage());
Arrays.stream(e.getStackTrace()).forEach(System.out::println);
message = e.getMessage();
costTime = System.currentTimeMillis() - stepStartTime;
success = false;
}
if (nonNull(content)) {
......@@ -277,10 +328,9 @@ public class SeleniumExecutor {
if (!success) {
screenShot = seleniumHelper.screenShot(driver, UUID.randomUUID().toString());
}
Long stepEndTime = System.currentTimeMillis();
return new Step()
.setSuccess(success)
.setCostTime(stepEndTime - stepStartTime)
.setCostTime(costTime)
.setContent(content)
.setMessage(message)
.setScreenShot(screenShot);
......@@ -376,6 +426,7 @@ public class SeleniumExecutor {
finished = -1;
total = -1;
steps.clear();
seleniumHelper.getHistoryHandles().clear();
}
private String getWindowHandle() {
......
package com.zjty.autotest.service;
import com.zjty.autotest.pojo.dbo.project.TestCaseDo;
import com.zjty.autotest.pojo.vo.project.Command;
import com.zjty.autotest.pojo.vo.project.TestCase;
import com.zjty.autotest.repository.TestCaseRepository;
import com.zjty.autotest.service.helper.TransHelper;
......@@ -9,9 +10,12 @@ import org.springframework.data.domain.PageRequest;
import org.springframework.stereotype.Service;
import java.util.ArrayList;
import java.util.List;
import java.util.Objects;
import java.util.stream.Collectors;
import static com.zjty.autotest.common.action.CommandType.OPEN;
import static java.lang.String.format;
@Service
......@@ -22,24 +26,34 @@ public class TestCaseService {
@Autowired
private TransHelper transHelper;
public void save(TestCase testCase) {
TestCaseDo testCaseDo = transHelper.testCaseDo(testCase);
public void save(TestCase testCase, Integer projectId, String url) {
List<Command> commands = new ArrayList<>();
List<Command> opens = testCase.getCommands().stream()
.filter(command -> Objects.equals(command.getCommand(), OPEN))
.map(command -> correctMissingUrl(command, url))
.collect(Collectors.toList());
List<Command> unOpens = testCase.getCommands().stream()
.filter(command -> !Objects.equals(command.getCommand(), OPEN))
.collect(Collectors.toList());
commands.addAll(opens);
commands.addAll(unOpens);
TestCaseDo testCaseDo = transHelper.testCaseDo(testCase.setCommands(commands)).setProjectId(projectId);
testCaseRepository.save(testCaseDo);
}
public List<TestCase> findAll(){
public List<TestCase> findAll() {
return testCaseRepository.findAll().stream()
.map(transHelper::testCase)
.collect(Collectors.toList());
}
public List<TestCase> findByPage(int page,int size){
public List<TestCase> findByPage(int page, int size) {
return testCaseRepository.findAll(PageRequest.of(page, size)).stream()
.map(transHelper::testCase)
.collect(Collectors.toList());
}
public TestCase findById(Integer id){
public TestCase findById(Integer id) {
return testCaseRepository.findById(id)
.map(transHelper::testCase)
.orElseThrow(() -> new RuntimeException(format("id为[%s]的测试用例不存在", id)));
......@@ -53,4 +67,15 @@ public class TestCaseService {
}
}
public void deleteAllByProjectId(Integer projectId) {
testCaseRepository.deleteAllByProjectId(projectId);
}
private Command correctMissingUrl(Command command, String url) {
if (Objects.equals(command.getTarget(), "/")) {
return command.setTarget(url);
}
return command;
}
}
......@@ -76,7 +76,6 @@ public class TransHelper {
public ReportVo reportVo(ReportDo reportDo) {
List<Step> steps = JsonUtil.readValue(reportDo.getSteps(), new TypeReference<List<Step>>() {
});
Integer total = reportDo.getTotal();
Integer finished = reportDo.getFinished();
Integer unfinished = total - finished < 0 ? 0 : total - finished;
......@@ -145,6 +144,7 @@ public class TransHelper {
projectDo.getName(),
null,
projectDo.getOs(),
null,
tests
);
}
......
......@@ -40,11 +40,11 @@ public class WebDriverUtil {
case Browser.FIREFOX:
// /opt/apps/org.mozilla.firefox/files/lib/firefox-esr/firefox-esr
System.setProperty("webdriver.firefox.driver", WebDriverUtil.FIRE_FOX + executable);
System.setProperty("webdriver.firefox.bin", "/home/hct/firefox/firefox");
FirefoxOptions firefoxOptions = new FirefoxOptions();
if (headless) {
firefoxOptions.addArguments("--headless");
}
firefoxOptions.setBinary("/opt/apps/org.mozilla.firefox/files/lib/firefox-esr/firefox-esr");
return new FirefoxDriver(firefoxOptions);
case Browser.CHROME:
System.setProperty("webdriver.chrome.driver", WebDriverUtil.CHROME + executable);
......@@ -79,6 +79,7 @@ public class WebDriverUtil {
default:
throw new RuntimeException("该浏览器不存在:" + browser);
}
}
}
{
"id": "b1f6e392-e31d-4a89-97b9-bc010474f157",
"version": "2.0",
"name": "test",
"url": "http://124.71.139.137:8080/txManage/#/",
"tests": [{
"id": "7e20cc1b-0f87-4593-8cad-f0dc17a9a711",
"name": "baidu",
"commands": [{
"id": "495d5a84-1743-42b2-8124-6c2e0d2ce746",
"comment": "",
"command": "open",
"target": "http://124.71.139.137:8080/txManage/#/",
"targets": [],
"value": ""
}, {
"id": "53d3d67a-057e-47e4-8941-32f0590d0381",
"comment": "",
"command": "setWindowSize",
"target": "717x707",
"targets": [],
"value": ""
}, {
"id": "0082bf52-4c4d-489d-b6f4-3153516a8586",
"comment": "",
"command": "click",
"target": "css=.el-form-item:nth-child(1) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(1) .el-input__inner", "css:finder"],
["xpath=//input[@type='text']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div[2]/div/form/div/div/div/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": ""
}, {
"id": "296a6664-d87e-40b7-aa88-5a466a4e94a3",
"comment": "",
"command": "type",
"target": "css=.el-form-item:nth-child(1) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(1) .el-input__inner", "css:finder"],
["xpath=//input[@type='text']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div[2]/div/form/div/div/div/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": "admin"
}, {
"id": "b0c72b95-7e15-4812-80f9-ab0a1bce7198",
"comment": "",
"command": "click",
"target": "css=.right",
"targets": [
["css=.right", "css:finder"],
["xpath=//div[@id='app']/div/div/div[2]", "xpath:idRelative"],
["xpath=//div[2]", "xpath:position"]
],
"value": ""
}, {
"id": "564b3a71-2611-4772-80e6-423313378c22",
"comment": "",
"command": "click",
"target": "css=.password-input > .el-input__inner",
"targets": [
["css=.password-input > .el-input__inner", "css:finder"],
["xpath=//input[@type='password']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div[2]/div/form/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//div[2]/div/div/input", "xpath:position"]
],
"value": ""
}, {
"id": "1a912d30-7d19-442d-b569-6b41114cc913",
"comment": "",
"command": "type",
"target": "css=.password-input > .el-input__inner",
"targets": [
["css=.password-input > .el-input__inner", "css:finder"],
["xpath=//input[@type='password']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div[2]/div/form/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//div[2]/div/div/input", "xpath:position"]
],
"value": "qwer1234"
}, {
"id": "6374caf5-c081-45e3-933d-e945168a263d",
"comment": "",
"command": "click",
"target": "css=.right",
"targets": [
["css=.right", "css:finder"],
["xpath=//div[@id='app']/div/div/div[2]", "xpath:idRelative"],
["xpath=//div[2]", "xpath:position"]
],
"value": ""
}, {
"id": "7b546755-6ce8-4eb7-93de-40c905aea83c",
"comment": "",
"command": "click",
"target": "css=.right",
"targets": [
["css=.right", "css:finder"],
["xpath=//div[@id='app']/div/div/div[2]", "xpath:idRelative"],
["xpath=//div[2]", "xpath:position"]
],
"value": ""
}, {
"id": "a9bc6ba8-e5d6-4467-9257-5214da95d8d7",
"comment": "",
"command": "click",
"target": "css=.el-button",
"targets": [
["css=.el-button", "css:finder"],
["xpath=//button[@type='button']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div[2]/div/form/div[3]/div/button", "xpath:idRelative"],
["xpath=//button", "xpath:position"],
["xpath=//button[contains(.,'登录')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "2a5935a1-66f9-495c-b7cd-fcc80b240079",
"comment": "",
"command": "click",
"target": "css=.newAdd > span > span",
"targets": [
["css=.newAdd > span > span", "css:finder"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[2]/div/button[2]/span/span", "xpath:idRelative"],
["xpath=//button[2]/span/span", "xpath:position"]
],
"value": ""
}, {
"id": "61417000-e96f-4980-8ebe-028ba7c446a3",
"comment": "",
"command": "click",
"target": "css=.el-upload-dragger > img",
"targets": [
["css=.el-upload-dragger > img", "css:finder"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[4]/div/div/div[2]/div[2]/div/div/div/img", "xpath:idRelative"],
["xpath=//div[2]/div/div/div/img", "xpath:position"]
],
"value": ""
}, {
"id": "6a0c157a-4f3e-4915-909d-e4ccb197fce3",
"comment": "",
"command": "click",
"target": "css=.content-wrap",
"targets": [
["css=.content-wrap", "css:finder"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[3]/div", "xpath:idRelative"],
["xpath=//div[3]/div", "xpath:position"]
],
"value": ""
}, {
"id": "93065f22-541a-4288-9a1b-d173126a0b5b",
"comment": "",
"command": "click",
"target": "css=.pic:nth-child(3) > .myImg",
"targets": [
["css=.pic:nth-child(3) > .myImg", "css:finder"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[3]/div/div[2]/div[3]/img", "xpath:idRelative"],
["xpath=//div[3]/img", "xpath:position"]
],
"value": ""
}, {
"id": "83c88668-1a19-4ff0-8224-6f1654b2f6ce",
"comment": "",
"command": "click",
"target": "css=.newAdd",
"targets": [
["css=.newAdd", "css:finder"],
["xpath=(//button[@type='button'])[2]", "xpath:attributes"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[2]/div/button[2]", "xpath:idRelative"],
["xpath=//button[2]", "xpath:position"],
["xpath=//button[contains(.,'新增')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "bdaf62c8-dda4-4a9b-a9bd-dad497ad051d",
"comment": "",
"command": "mouseOver",
"target": "css=.newAdd",
"targets": [
["css=.newAdd", "css:finder"],
["xpath=(//button[@type='button'])[2]", "xpath:attributes"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[2]/div/button[2]", "xpath:idRelative"],
["xpath=//button[2]", "xpath:position"],
["xpath=//button[contains(.,'新增')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "e8fd081d-0089-4374-aec5-5ad7b98f1945",
"comment": "",
"command": "mouseOut",
"target": "css=.newAdd",
"targets": [
["css=.newAdd", "css:finder"],
["xpath=(//button[@type='button'])[2]", "xpath:attributes"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[2]/div/button[2]", "xpath:idRelative"],
["xpath=//button[2]", "xpath:position"],
["xpath=//button[contains(.,'新增')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "1f5831f9-0462-4244-9282-3fd02082e2b9",
"comment": "",
"command": "click",
"target": "css=.el-upload-dragger > img",
"targets": [
["css=.el-upload-dragger > img", "css:finder"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[4]/div/div/div[2]/div[2]/div/div/div/img", "xpath:idRelative"],
["xpath=//div[2]/div/div/div/img", "xpath:position"]
],
"value": ""
}, {
"id": "da83171e-0c14-4029-9076-f150c7703fad",
"comment": "",
"command": "type",
"target": "name=file",
"targets": [
["name=file", "name"],
["css=.el-upload__input", "css:finder"],
["xpath=//input[@name='file']", "xpath:attributes"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[4]/div/div/div[2]/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//div[2]/div[2]/div/div/input", "xpath:position"]
],
"value": ""
}, {
"id": "42704119-5326-45ae-b778-b6f408bf327b",
"comment": "",
"command": "click",
"target": "css=.el-input__inner",
"targets": [
["css=.el-input__inner", "css:finder"],
["xpath=//input[@type='text']", "xpath:attributes"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[4]/div/div/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": ""
}, {
"id": "dd327b37-8b67-47cb-bdb8-767f4dbc3f89",
"comment": "",
"command": "click",
"target": "css=.el-input__inner",
"targets": [
["css=.el-input__inner", "css:finder"],
["xpath=//input[@type='text']", "xpath:attributes"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[4]/div/div/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": ""
}, {
"id": "0c9f4ad8-8889-4373-951b-81d192cb07cd",
"comment": "",
"command": "click",
"target": "css=.addDialog > .el-dialog__wrapper",
"targets": [
["css=.addDialog > .el-dialog__wrapper", "css:finder"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[4]/div", "xpath:idRelative"],
["xpath=//main/div[2]/div[4]/div", "xpath:position"]
],
"value": ""
}, {
"id": "2b913c62-32dc-4b4a-acbc-2fb7df07abdb",
"comment": "",
"command": "click",
"target": "css=.content-wrap",
"targets": [
["css=.content-wrap", "css:finder"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[3]/div", "xpath:idRelative"],
["xpath=//div[3]/div", "xpath:position"]
],
"value": ""
}, {
"id": "8ad77d1b-c7c2-44ec-8870-5a7ddb9c82dd",
"comment": "",
"command": "type",
"target": "name=file",
"targets": [
["name=file", "name"],
["css=.el-upload__input", "css:finder"],
["xpath=//input[@name='file']", "xpath:attributes"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[4]/div/div/div[2]/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//div[2]/div[2]/div/div/input", "xpath:position"]
],
"value": "/home/hct/Pictures/整体.png"
}, {
"id": "9c3b31b5-84ae-4d5c-9897-8b463f7b9c56",
"comment": "",
"command": "click",
"target": "css=.el-dialog__footer:nth-child(3) .yes > span",
"targets": [
["css=.el-dialog__footer:nth-child(3) .yes > span", "css:finder"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[4]/div/div/div[3]/span/button[2]/span", "xpath:idRelative"],
["xpath=//span/button[2]/span", "xpath:position"]
],
"value": ""
}]
}],
"suites": [{
"id": "4cae0cff-7d48-4765-b5af-31f414c17939",
"name": "Default Suite",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["7e20cc1b-0f87-4593-8cad-f0dc17a9a711"]
}],
"urls": [],
"plugins": []
}
\ No newline at end of file
{
"id": "b1f6e392-e31d-4a89-97b9-bc010474f157",
"version": "2.0",
"name": "test",
"url": "http://124.71.139.137:8080/txManage/#/",
"tests": [{
"id": "7e20cc1b-0f87-4593-8cad-f0dc17a9a711",
"name": "baidu",
"commands": [{
"id": "495d5a84-1743-42b2-8124-6c2e0d2ce746",
"comment": "",
"command": "open",
"target": "http://124.71.139.137:8080/txManage/#/",
"targets": [],
"value": ""
}, {
"id": "53d3d67a-057e-47e4-8941-32f0590d0381",
"comment": "",
"command": "setWindowSize",
"target": "717x707",
"targets": [],
"value": ""
}, {
"id": "0082bf52-4c4d-489d-b6f4-3153516a8586",
"comment": "",
"command": "click",
"target": "css=.el-form-item:nth-child(1) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(1) .el-input__inner", "css:finder"],
["xpath=//input[@type='text']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div[2]/div/form/div/div/div/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": ""
}, {
"id": "296a6664-d87e-40b7-aa88-5a466a4e94a3",
"comment": "",
"command": "type",
"target": "css=.el-form-item:nth-child(1) .el-input__inner",
"targets": [
["css=.el-form-item:nth-child(1) .el-input__inner", "css:finder"],
["xpath=//input[@type='text']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div[2]/div/form/div/div/div/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": "admin"
}, {
"id": "b0c72b95-7e15-4812-80f9-ab0a1bce7198",
"comment": "",
"command": "click",
"target": "css=.right",
"targets": [
["css=.right", "css:finder"],
["xpath=//div[@id='app']/div/div/div[2]", "xpath:idRelative"],
["xpath=//div[2]", "xpath:position"]
],
"value": ""
}, {
"id": "564b3a71-2611-4772-80e6-423313378c22",
"comment": "",
"command": "click",
"target": "css=.password-input > .el-input__inner",
"targets": [
["css=.password-input > .el-input__inner", "css:finder"],
["xpath=//input[@type='password']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div[2]/div/form/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//div[2]/div/div/input", "xpath:position"]
],
"value": ""
}, {
"id": "1a912d30-7d19-442d-b569-6b41114cc913",
"comment": "",
"command": "type",
"target": "css=.password-input > .el-input__inner",
"targets": [
["css=.password-input > .el-input__inner", "css:finder"],
["xpath=//input[@type='password']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div[2]/div/form/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//div[2]/div/div/input", "xpath:position"]
],
"value": "qwer1234"
}, {
"id": "6374caf5-c081-45e3-933d-e945168a263d",
"comment": "",
"command": "click",
"target": "css=.right",
"targets": [
["css=.right", "css:finder"],
["xpath=//div[@id='app']/div/div/div[2]", "xpath:idRelative"],
["xpath=//div[2]", "xpath:position"]
],
"value": ""
}, {
"id": "7b546755-6ce8-4eb7-93de-40c905aea83c",
"comment": "",
"command": "click",
"target": "css=.right",
"targets": [
["css=.right", "css:finder"],
["xpath=//div[@id='app']/div/div/div[2]", "xpath:idRelative"],
["xpath=//div[2]", "xpath:position"]
],
"value": ""
}, {
"id": "a9bc6ba8-e5d6-4467-9257-5214da95d8d7",
"comment": "",
"command": "click",
"target": "css=.el-button",
"targets": [
["css=.el-button", "css:finder"],
["xpath=//button[@type='button']", "xpath:attributes"],
["xpath=//div[@id='app']/div/div/div[2]/div/form/div[3]/div/button", "xpath:idRelative"],
["xpath=//button", "xpath:position"],
["xpath=//button[contains(.,'登录')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "2a5935a1-66f9-495c-b7cd-fcc80b240079",
"comment": "",
"command": "click",
"target": "css=.newAdd > span > span",
"targets": [
["css=.newAdd > span > span", "css:finder"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[2]/div/button[2]/span/span", "xpath:idRelative"],
["xpath=//button[2]/span/span", "xpath:position"]
],
"value": ""
}, {
"id": "6a0c157a-4f3e-4915-909d-e4ccb197fce3",
"comment": "",
"command": "click",
"target": "css=.content-wrap",
"targets": [
["css=.content-wrap", "css:finder"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[3]/div", "xpath:idRelative"],
["xpath=//div[3]/div", "xpath:position"]
],
"value": ""
}, {
"id": "93065f22-541a-4288-9a1b-d173126a0b5b",
"comment": "",
"command": "click",
"target": "css=.pic:nth-child(3) > .myImg",
"targets": [
["css=.pic:nth-child(3) > .myImg", "css:finder"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[3]/div/div[2]/div[3]/img", "xpath:idRelative"],
["xpath=//div[3]/img", "xpath:position"]
],
"value": ""
}, {
"id": "83c88668-1a19-4ff0-8224-6f1654b2f6ce",
"comment": "",
"command": "click",
"target": "css=.newAdd",
"targets": [
["css=.newAdd", "css:finder"],
["xpath=(//button[@type='button'])[2]", "xpath:attributes"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[2]/div/button[2]", "xpath:idRelative"],
["xpath=//button[2]", "xpath:position"],
["xpath=//button[contains(.,'新增')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "bdaf62c8-dda4-4a9b-a9bd-dad497ad051d",
"comment": "",
"command": "mouseOver",
"target": "css=.newAdd",
"targets": [
["css=.newAdd", "css:finder"],
["xpath=(//button[@type='button'])[2]", "xpath:attributes"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[2]/div/button[2]", "xpath:idRelative"],
["xpath=//button[2]", "xpath:position"],
["xpath=//button[contains(.,'新增')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "e8fd081d-0089-4374-aec5-5ad7b98f1945",
"comment": "",
"command": "mouseOut",
"target": "css=.newAdd",
"targets": [
["css=.newAdd", "css:finder"],
["xpath=(//button[@type='button'])[2]", "xpath:attributes"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[2]/div/button[2]", "xpath:idRelative"],
["xpath=//button[2]", "xpath:position"],
["xpath=//button[contains(.,'新增')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "da83171e-0c14-4029-9076-f150c7703fad",
"comment": "",
"command": "type",
"target": "name=file",
"targets": [
["name=file", "name"],
["css=.el-upload__input", "css:finder"],
["xpath=//input[@name='file']", "xpath:attributes"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[4]/div/div/div[2]/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//div[2]/div[2]/div/div/input", "xpath:position"]
],
"value": "/home/hct/Pictures/整体.png"
}, {
"id": "42704119-5326-45ae-b778-b6f408bf327b",
"comment": "",
"command": "click",
"target": "css=.el-input__inner",
"targets": [
["css=.el-input__inner", "css:finder"],
["xpath=//input[@type='text']", "xpath:attributes"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[4]/div/div/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": ""
}, {
"id": "dd327b37-8b67-47cb-bdb8-767f4dbc3f89",
"comment": "",
"command": "click",
"target": "css=.el-input__inner",
"targets": [
["css=.el-input__inner", "css:finder"],
["xpath=//input[@type='text']", "xpath:attributes"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[4]/div/div/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": ""
}, {
"id": "0c9f4ad8-8889-4373-951b-81d192cb07cd",
"comment": "",
"command": "click",
"target": "css=.addDialog > .el-dialog__wrapper",
"targets": [
["css=.addDialog > .el-dialog__wrapper", "css:finder"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[4]/div", "xpath:idRelative"],
["xpath=//main/div[2]/div[4]/div", "xpath:position"]
],
"value": ""
}, {
"id": "2b913c62-32dc-4b4a-acbc-2fb7df07abdb",
"comment": "",
"command": "click",
"target": "css=.content-wrap",
"targets": [
["css=.content-wrap", "css:finder"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[3]/div", "xpath:idRelative"],
["xpath=//div[3]/div", "xpath:position"]
],
"value": ""
}, {
"id": "8ad77d1b-c7c2-44ec-8870-5a7ddb9c82dd",
"comment": "",
"command": "type",
"target": "name=file",
"targets": [
["name=file", "name"],
["css=.el-upload__input", "css:finder"],
["xpath=//input[@name='file']", "xpath:attributes"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[4]/div/div/div[2]/div[2]/div/div/input", "xpath:idRelative"],
["xpath=//div[2]/div[2]/div/div/input", "xpath:position"]
],
"value": "/home/hct/Pictures/整体.png"
}, {
"id": "9c3b31b5-84ae-4d5c-9897-8b463f7b9c56",
"comment": "",
"command": "click",
"target": "css=.el-dialog__footer:nth-child(3) .yes > span",
"targets": [
["css=.el-dialog__footer:nth-child(3) .yes > span", "css:finder"],
["xpath=//div[@id='app']/div/section/section/main/div[2]/div[4]/div/div/div[3]/span/button[2]/span", "xpath:idRelative"],
["xpath=//span/button[2]/span", "xpath:position"]
],
"value": ""
}]
}],
"suites": [{
"id": "4cae0cff-7d48-4765-b5af-31f414c17939",
"name": "Default Suite",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["7e20cc1b-0f87-4593-8cad-f0dc17a9a711"]
}],
"urls": [],
"plugins": []
}
\ No newline at end of file
{
"id": "e81b676c-9338-426e-b438-00893a06f577",
"version": "2.0",
"name": "person",
"url": "https://www.txdx.gov.cn/",
"tests": [{
"id": "a5bb3225-2d62-48f9-bebb-15a6a772481a",
"name": "Untitled",
"commands": [{
"id": "b0948dde-8cca-49db-bc35-ee7ee49e33cf",
"comment": "",
"command": "open",
"target": "https://www.txdx.gov.cn/",
"targets": [],
"value": ""
}, {
"id": "3ab60d1b-1752-4cd8-8f15-9c8de5e0d999",
"comment": "",
"command": "setWindowSize",
"target": "1536x784",
"targets": [],
"value": ""
}, {
"id": "559df20e-305f-49c1-a93e-f3bb5c1e3688",
"comment": "",
"command": "click",
"target": "id=type",
"targets": [
["id=type", "id"],
["name=type", "name"],
["css=#type", "css:finder"],
["xpath=//select[@id='type']", "xpath:attributes"],
["xpath=//form[@id='form2']/select", "xpath:idRelative"],
["xpath=//select", "xpath:position"]
],
"value": ""
}, {
"id": "63e957d1-1580-442d-8039-d9f73760add9",
"comment": "",
"command": "select",
"target": "id=type",
"targets": [],
"value": "label=全文"
}, {
"id": "a00ab112-ae04-4733-9dbb-902525ef6f8f",
"comment": "",
"command": "click",
"target": "css=#type > option:nth-child(2)",
"targets": [
["css=#type > option:nth-child(2)", "css:finder"],
["xpath=//select[@id='type']/option[2]", "xpath:idRelative"],
["xpath=//option[2]", "xpath:position"],
["xpath=//option[contains(.,'全文')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "7bf67926-6a77-47be-b0f1-5cefc7261e8e",
"comment": "",
"command": "click",
"target": "id=keyword",
"targets": [
["id=keyword", "id"],
["name=keyword", "name"],
["css=#keyword", "css:finder"],
["xpath=//input[@id='keyword']", "xpath:attributes"],
["xpath=//form[@id='form2']/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": ""
}, {
"id": "a6a1d44d-03e6-49e3-a749-0d981824f933",
"comment": "",
"command": "type",
"target": "id=keyword",
"targets": [
["id=keyword", "id"],
["name=keyword", "name"],
["css=#keyword", "css:finder"],
["xpath=//input[@id='keyword']", "xpath:attributes"],
["xpath=//form[@id='form2']/input", "xpath:idRelative"],
["xpath=//input", "xpath:position"]
],
"value": "123"
}, {
"id": "2619cf4b-f17c-4846-b6c6-03f9c04da932",
"comment": "",
"command": "click",
"target": "id=search",
"targets": [
["id=search", "id"],
["name=search", "name"],
["css=#search", "css:finder"],
["xpath=//input[@id='search']", "xpath:attributes"],
["xpath=//form[@id='form2']/input[2]", "xpath:idRelative"],
["xpath=//input[2]", "xpath:position"]
],
"value": ""
}, {
"id": "5a530821-7586-4523-aadd-6b263726f1b5",
"comment": "",
"command": "click",
"target": "linkText=学校概况",
"targets": [
["linkText=学校概况", "linkText"],
["css=li:nth-child(2) > a", "css:finder"],
["xpath=//a[contains(text(),'学校概况')]", "xpath:link"],
["xpath=//a[contains(@href, '/index.php?m=Article&a=cate&id=1')]", "xpath:href"],
["xpath=//li[2]/a", "xpath:position"],
["xpath=//a[contains(.,'学校概况')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "f775bad0-1eeb-4a77-a3b0-69ecea6576b9",
"comment": "",
"command": "click",
"target": "linkText=首页",
"targets": [
["linkText=首页", "linkText"],
["css=li > .cur", "css:finder"],
["xpath=//a[contains(text(),'首页')]", "xpath:link"],
["xpath=//a[contains(@href, '/')]", "xpath:href"],
["xpath=//a", "xpath:position"],
["xpath=//a[contains(.,'首页')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "fdfb1624-7932-499b-96ae-a8ee9e9490c5",
"comment": "",
"command": "click",
"target": "name=d2",
"targets": [
["name=d2", "name"],
["css=td > select:nth-child(1)", "css:finder"],
["xpath=//select[@name='d2']", "xpath:attributes"],
["xpath=//td[2]/select", "xpath:position"]
],
"value": "",
"opensWindow": true,
"windowHandleName": "win5003",
"windowTimeout": 2000
}, {
"id": "3046b1b2-3c96-4216-8eae-2b40de9c0182",
"comment": "",
"command": "select",
"target": "name=d2",
"targets": [],
"value": "label=平湖市委党校"
}, {
"id": "b939c7a3-6c5f-4f17-8438-9e1264b00abd",
"comment": "",
"command": "click",
"target": "css=select:nth-child(1) > option:nth-child(6)",
"targets": [
["css=select:nth-child(1) > option:nth-child(6)", "css:finder"],
["xpath=//option[@value='http://dangxiao.pinghu.gov.cn']", "xpath:attributes"],
["xpath=//option[6]", "xpath:position"],
["xpath=//option[contains(.,'平湖市委党校')]", "xpath:innerText"]
],
"value": ""
}, {
"id": "55510092-3efa-404f-9000-9b8acb915691",
"comment": "",
"command": "storeWindowHandle",
"target": "root",
"targets": [],
"value": ""
}, {
"id": "6d3769b4-0dea-4757-b7c3-7fbd032253fd",
"comment": "",
"command": "selectWindow",
"target": "handle=${win5003}",
"targets": [],
"value": ""
}, {
"id": "5eea0362-7f04-4cda-ad12-a159d758aeec",
"comment": "",
"command": "close",
"target": "",
"targets": [],
"value": ""
}, {
"id": "e414cacb-840a-48fb-87c8-d230404a1624",
"comment": "",
"command": "selectWindow",
"target": "handle=${root}",
"targets": [],
"value": ""
}, {
"id": "8754f4c4-c897-4791-9f66-fe5124e69a27",
"comment": "",
"command": "close",
"target": "",
"targets": [],
"value": ""
}]
}],
"suites": [{
"id": "2d55aeb7-d110-42b4-93d8-bd01f67152fe",
"name": "Default Suite",
"persistSession": false,
"parallel": false,
"timeout": 300,
"tests": ["a5bb3225-2d62-48f9-bebb-15a6a772481a"]
}],
"urls": [],
"plugins": []
}
\ No newline at end of file
Markdown 格式
0%
您添加了 0 到此讨论。请谨慎行事。
请先完成此评论的编辑!
注册 或者 后发表评论