package com.com.sxf;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.testng.annotations.Test;
public class SeleniumTestNg {
WebDriver driver;
@Test(invocationCount = 3)
public void login() {
System.setProperty(“webdriver.firefox.bin”, “C://Program Files (x86)//Mozilla Firefox//firefox.exe”);
driver = new FirefoxDriver();
driver.get(“http://10.100.3.2/mainsite/src/html/login/login.html”);
}
}
本文介绍了一个使用Selenium WebDriver和TestNG框架进行自动化测试的示例代码。该代码展示了如何通过设置Firefox浏览器的路径,多次运行登录测试用例。
2667

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



