(一)我编写的测试用例,会将其一步步转化成脚本
插图(由于测试用例跟新了,此处就不贴了,我会在下面详细讲每个脚本的作用)
(二)自动化脚本编写,与测试用例相对应
1.注册模块(HIL01-001)
注意下面将By by 和findElement方法进行了封装,你们也可以判断一下文本框是否可用之类的,在这儿,我省略了
package com.siteTest;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;
public class siteTest {
public WebDriver driver;
@Test
public void showBaidu(){
System.setProperty("webdriver.chrome.driver", "D:\\chromedriver_2.38\\chromedriver.exe");
driver = new ChromeDriver();
driver.get("公司网站");
}
@Test(dependsOnMethods={"showBaidu"})
//用例HIL01-001,注册模块
public void zhuce(){
findEle(byStr("xpath","//*[@id='app']/div/div/div[1]/div/div[2]/div[3]/div[1]")).click();
try {
Thread.sleep(2000);
} catch (InterruptedException e) {
// TODO Auto-

本文档记录了将测试用例转化为自动化测试脚本的过程,包括注册模块的测试,如(HIL01-001, HIL01-003)的实现,涉及复制粘贴功能的模拟以及处理选择时间段的逻辑。同时,介绍了如何通过自动化脚本来检查用户注册后设备数量的更新,并展示了如何通过自动化完成页面悬停操作确保正确跳转到登录页面。"
101509207,8669706,C#实现鼠标绘图技术详解,"['C#', '图形编程', 'GUI开发']
最低0.47元/天 解锁文章
738

被折叠的 条评论
为什么被折叠?



