20220710 web自动化测试实战二

实战目标

  • PO设计模式

课堂ppt

PPT地址

报错

java.lang.NoSuchMethodError: com.google.common.collect.ImmutableMap.of(Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;Ljava/lang/Object;)Lcom/google/common/collect/ImmutableMap;

解决方式一:

    <dependencyManagement>
        <dependencies>
            <dependency>
                <groupId>com.google.guava</groupId>
                <artifactId>guava</artifactId>
                <version>31.0.1-jre</version>
            </dependency>
        </dependencies>
    </dependencyManagement>

解决方式2:

<dependency>  
    <groupId>io.github.bonigarcia</groupId>  
    <artifactId>webdrivermanager</artifactId>  
    <version>5.0.3</version>  
    <exclusions>  
        <exclusion>  
            <groupId>com.google.guava</groupId>  
            <artifactId>guava</artifactId>  
        </exclusion>  
    </exclusions>  
</dependency>

随机数

<dependencies>
        <dependency>
            <groupId>com.github.javafaker</groupId>
            <artifactId>javafaker</artifactId>
            <version>1.0.2</version>
        </dependency>

    </dependencies>


ChromeOptions option = new ChromeOptions();
//不显示 Chrome正受到自动测试软件的控制 提示栏
option.setExperimentalOption("excludeSwitches", new String[] {"enable-automation","load-extension"});
// 最大化窗口
option.addArguments("--start-maximized");

作业

  • 删除成员用例
  • 添加成员、删除成员参数化
  • suite套件顺序运行添加成员、删除成员
  • 生成allure报告,添加步骤截图、解释说明、用例说明