如何使用Selenium Web驱动程序测试单个注册页面并向开发团队提供测试报告



我知道基本的Selenium Web驱动程序,并且还使用testng框架中的页面对象模型编写了代码,用于一个小型应用程序注册和登录页面。我不知道,如何向开发团队提供测试报告,以及自动化测试的检查点是什么,请帮助我。

示例:

假设我的应用程序有两个页面,例如注册和签名页

我的代码:

public class Sample {
    Authentication_Locators authenticate;
    WebDriver d = null;

    @BeforeTest
    public void beforeTest() throws Exception {
        d = InitDriver.wbDriver("chrome", testData.getProperty("testUrl"));
        authenticate = PageFactory.initElements(d, 
        Authentication_Locators.class);
    }
    @Test (priority = 0)
    public void signIn() throws Exception {
        Thread.sleep(1000);
        authenticate.userName.sendKeys("user1");
        authenticate.password.sendKeys("password1");
        authenticate.signin.Click();
    }
}

tesgng创建的HTML报告,该报告位于当前工作目录中的结果文件夹中,带有名称emailable_report。此外,对于更准确的报告,您也可以使用柔软而硬的断言。

希望这会有所帮助。

最新更新