Professional Documents
Culture Documents
Non Static
Non Static
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;
WebDriver driver;
@Test
public void login_test() throws Exception
{
TC01_Login x1=new TC01_Login ;
x1.openchromebrowser();
x1.login_test1();
}
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();