Wednesday, 4 May 2022

Using Locators in Selenium using Java | Learning Automation | Eclipse


import org.openqa.selenium.By;
import org.openqa.selenium.WebDriver;
import org.openqa.selenium.chrome.ChromeDriver;

public class locatorpractice {

public static void main(String[] args) {


System.setProperty("webdriver.chrome.driver","C:/chromedriver_win32/chromedriver.exe");
WebDriver driver = new ChromeDriver();

driver.get("https://www.google.co.in/");
driver.manage().window().maximize();
driver.findElement(By.linkText("Sign in")).click();
driver.findElement(By.id ("identifierId")).sendKeys("test@gmail.com");
driver.findElement(By.className("VfPpkd-vQzf8d")).click();



}

}

No comments:

Post a Comment

User Login, Logout on Edge, Chrome, Firefox using Java with Selenium | Learn Coding

import org.openqa.selenium.By ; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import org.openqa.sele...