Great Gatsby
0
Q:

how to find selenium webelement java

- Everything we see on a web page is a webelement.
    such as: buttons, links, input boxes, dropdowns etc...
0
//required imports 
WebDriver driver = new ChromeDriver();
WebElement objWE;
//There are many way most common are id and xpath
objWE = driver.findElement(By.id("String of id attribute"));
//To find the xpath easily hit F12 and right click the element you want
//and copy xpath then paste it
objWE = driver.findElement(By.xpath("//*[@id="search"]/div[2]/div[6]/div[1]/div/div"));
0

New to Communities?

Join the community