admin管理员组文章数量:1122832
I am new to java with maven program and is executing the login with orange hrm website I am using java 8 version and in the pom.xml file the selenium is with lower verion of selenium i.e 4.11 and testng 6.10 version but is not able to execute the code getting the testng file not able to found. `package day1;
//import org.junit.BeforeClass;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.WebElement;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotation.BeforeClass;
import org.testng.annotation.AfterClass;
import org.testng.annotation.Test;
public class sele_maven {
//public static void main(String[] args) throws InterruptedException {
WebDriver driver;
@BeforeClass
public void setUp() {
System.setProperty("webdriver.chrome.driver",
"C:\\Users\\singh\\Downloads\\chromedriver.exe");
WebDriver driver = new ChromeDriver();
driver.manage().window().maximize();
driver.get(".php/auth/login");
}
@AfterClass
public void tearDown() {
driver.quit(); //close all the window
}
@Test
public void testLoggingApp() throws InterruptedException {
Thread.sleep(2000);
WebElement uname=driver.findElement(By.xpath("//input[@name='username']"));
uname.sendKeys("Admin");
WebElement pname=driver.findElement(By.xpath("//input[@name='password']"));
pname.sendKeys("admin123");
driver.findElement(By.xpath("//button[@type='submit']")).click();
}
} '
本文标签:
版权声明:本文标题:Getting error java: package org.testng.annotation does not exist while executing the first java with maven program to launch the 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736280968a1926167.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论