【发布时间】:2013-04-23 03:39:49
【问题描述】:
我正在尝试在 Eclipse(版本 3.7.0)中使用 Junit4 执行一个简单的测试用例
1) 我点击运行图标(在调试图标旁边),然后点击运行方式选项,它只显示 Java 应用程序作为选项 2) 当我单击运行配置选项时,在创建、管理和运行配置窗口中,我看到左侧窗格中列出了 Junit 和 TestNG
3)点击 Window>show views>我可以看到 Junit 和 TestNG 作为一个选项列出
请告诉我如何解决这个问题。谢谢!
项目名称:webDriverMethods
下面是我的代码
import org.junit.*;
import static org.junit.Assert.*;
import java.util.*;
import org.testng.annotations.*;
import org.testng.annotations.Test; //added 5 imports for Junit and testNG
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.htmlunit.HtmlUnitDriver;
import org.openqa.selenium.firefox.FirefoxDriver;
public class webDriverMethodsTest
{
@Test
public static void main(String[] args)
{
WebDriver driver = new FirefoxDriver();
driver.get("http://www.google.com");
}
}
【问题讨论】: