public class LoginPage { private WebElement usernameInput; private WebElement passwordInput; private WebElement loginButton; // ... } HolmosBrowser.open("https://www.example.com/login"); LoginPage loginPage = new LoginPage(); loginPage.usernameInput.sendKeys("user123"); loginPage.passwordInput.sendKeys("pass123"); loginPage.loginButton.click(); @DataDriven @TestData(dataSource = "testdata.xls", sheetName = "login") public void testLogin(String username, String password) { LoginPage loginPage = new LoginPage(); loginPage.usernameInput.sendKeys(username); loginPage.passwordInput.sendKeys(password); loginPage.loginButton.click(); // ... } <config> <report> <outputPath>/path/to/reports</outputPath> <showPassRate>true</showPassRate> <captureScreenshotOnFailure>true</captureScreenshotOnFailure> </report> </config>


上一篇:
下一篇:
切换中文