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();
}

} '

本文标签: