0
错误我不能运行TestNG的测试,获得“Cannot find class in classpath: TestNG1
”错误控制台。我不能运行TestNG的测试,得到“无法在类路径中寻找类:TestNG1”控制台
这是用TestNG
我不能运行TestNG的测试,我的第一次测试,让控制台“Cannot find class in classpath: TestNG1
”的错误。
我不能运行TestNG的测试,获得“Cannot find class in classpath: TestNG1
”错误控制台。
package automatiomFramework;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.firefox.FirefoxDriver;
import org.openqa.selenium.support.ui.Select;
import org.testng.annotations.Test;
import org.testng.annotations.BeforeMethod;
import org.testng.annotations.AfterMethod;
import org.testng.TestNGException;
public class TestNG1 {
public WebDriver driver;
@Test
public void f() {
driver.findElement(By.xpath(".//*[@id='topstrip123']/ul/li[5]/a")).click();
Select oSelect = new Select(driver.findElement(By.id("ddlTitle")));
oSelect.selectByIndex(2);
Select oSelect1 = new Select(driver.findElement(By.id("ddlTitle")));
oSelect1.selectByVisibleText("Mr.");
driver.findElement(By.id("txtEmailsignup")).sendKeys("gjadj[email protected]");
driver.findElement(By.id("txtPassword1")).sendKeys("password123");
driver.findElement(By.id("txtCnfPassword")).sendKeys("password123");
driver.findElement(By.id("Checkbox1")).click();
driver.findElement(By.id("btnSignup")).click();
driver.switchTo().alert().accept();
driver.findElement(By.id("Checkbox1")).click();
driver.findElement(By.id("btnSignup")).click();
driver.switchTo().alert().accept();
driver.findElement(By.id("chksubscribe")).click();
WebElement radioBtn = driver.findElement(By.id("rbMailpre_1"));
radioBtn.click();
driver.findElement(By.id("btnLogin")).click();
}
@BeforeMethod
public void beforeMethod() {
driver = new FirefoxDriver();
String url = "http://www.yepme.com";
driver.get(url);
}
@AfterMethod
public void afterMethod() {
driver.close();
}
}
有你提到的testng.xml类的名字? –
发布testng xml配置。 –
我无法创建XML文件,它显示文件是空的。请帮助我。 – Sundarrajapandian