安装后无法在eclipse neon中看到TestNG

时间:2017-04-06 14:38:54

标签: selenium-webdriver

我成功地从eclipse市场安装了TestNG,但是无法在windows-preference中看到TestNG。我有eclipse neon和最新的jdk版本java SE 8u121。有没有人知道?

1 个答案:

答案 0 :(得分:0)

  1. Install TestNG in Eclipse either navigating to "Help -> Install New Software" or from "Eclipse Market Place"
  2. Check whether TestNG successfully got installed or not: -In Eclipse Browse to: "Window -> Show View -> Other -> Java" -TestNG must be listed.
  3. Add TestNG library from "Project -> Properties -> Java Build Path -> Add Library -> Select TestNG -> Apply -> OK"
  4. Create a simple Test Script as follows;

package gmail;

import org.testng.annotations.Test;

public class gmailLoginTestNG {

@Test
public void test1()
{
    System.out.println("Within Test 1");
}

@Test
public void test2()
{
    System.out.println("Within Test 2");
}

@Test
public void test3()
{
    System.out.println("Within Test 3");
}

}

  1. Right Click & Run As "TestNG Test"

Let me know if this helps you.