Download as txt, pdf, or txt
Download as txt, pdf, or txt
You are on page 1of 1

package TC01_login;

import org.apache.xmlbeans.impl.xb.xsdschema.Public;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
import org.testng.annotations.Test;

public class TC01_Login {

WebDriver driver;

@Test
public void login_test() throws Exception
{
TC01_Login x1=new TC01_Login ;
x1.openchromebrowser();
x1.login_test1();
}

public void openchromebrowser() throws Exception


{

System.setProperty("webdriver.chrome.driver","C:\\chromedriver_win32\\
chromedriver.exe");
driver =new ChromeDriver();
driver.manage().window().maximize() ;
driver.get("https://opensource-demo.orangehrmlive.com/");

driver.findElement(By.name("txtUsername")).sendKeys("Admin");
//driver.findElement(By.id("txtUsername")).sendKeys("Admin");
driver.findElement(By.id("txtPassword")).sendKeys("admin123");
driver.findElement(By.xpath("//*[@id=\"btnLogin\"]")).click();

public void login_test1() throws Exception


{
driver.findElement(By.id("menu_admin_viewAdminModule")).click();
driver.findElement(By.id("menu_admin_Qualifications")).click();
driver.findElement(By.id("menu_admin_viewSkills")).click();
driver.findElement(By.id("btnAdd")).click();
driver.findElement(By.id("skill_name")).sendKeys("autocad");
driver.findElement(By.id("skill_description")).sendKeys("good");
driver.findElement(By.id("btnSave")).click();
}

You might also like