A locator is a way to identify elements on a page. It is the argument passed to the Finding element methods.
Type Locator Selenium
LocatorDescriptionBy.id(“IdHtml”)Locates elements whose ID attribute matches the search valueBy.name(“NameAtributeHtml”)Locates elements whose NAME attribute matches the search valueBy.xpath(“Path”)Locates elements matching an XPath expressionBy.className(“className”)Locates elements whose class name contains the search value (compound class names […]
Learn Selenium
Download Browser ( in my case, download chrome) Download Web Driver browser Chrome (note: make sure version driver same with browser) Let’s Code
pom.xml
<dependency> <groupId>org.seleniumhq.selenium</groupId> <artifactId>selenium-java</artifactId> <version>4.15.0</version> </dependency>
App.java
package com.putracode; import org.openqa.selenium.WebDriver; import org.openqa.selenium.chrome.ChromeDriver; import java.util.logging.Level; import java.util.logging.Logger; /** * Hello world! * */ public class App { public static […]