Raj Singh Locator
Raj Singh Locator
LOCATOR
Code:
package Assignmet12;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
System.setProperty("webdriver.chrome.driver", "D:\\sachin\\chromedriver.exe");
wd.get("http://demo.guru99.com/test/newtours/");
wd.findElement(By.name("userName")).sendKeys("Admin123");
wd.findElement(By.name("password")).sendKeys("admin123");
wd.findElement(By.name("submit")).click();
try {
Thread.sleep(5000);
} catch (InterruptedException e) {
e.printStackTrace();
wd.quit();
Output:
202-D-RAJ SINGH
package Assignmet12;
import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;
System.setProperty("webdriver.chrome.driver", "D:\\sachin\\chromedriver.exe");
wd.get("https://opensource-demo.orangehrmlive.com/");
wd.manage().window().maximize();
wd.findElement(By.name("username")).sendKeys("Admin");
wd.findElement(By.name("password")).sendKeys("admin123");
wd.findElement(By.xpath("//button[@type='submit']")).click();
wd.findElement(By.xpath("//span[text()='Welcome']")).click();
wd.findElement(By.linkText("Logout")).click();
wd.quit();
Output:
202-D-RAJ SINGH