Created
September 8, 2020 17:25
-
-
Save ShamaUgale/0c2e9174680b510315f3feb24c9d4366 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import org.openqa.selenium.By; | |
import org.openqa.selenium.WebElement; | |
import org.openqa.selenium.chrome.ChromeDriver; | |
import java.util.List; | |
public class FindsByExample { | |
final static String PROJECT_PATH = System.getProperty("user.dir"); | |
public static void main(String[] args) { | |
System.setProperty("webdriver.chrome.driver", PROJECT_PATH+ "/src/main/resources/chromedriver"); | |
ChromeDriver driver = new ChromeDriver(); | |
driver.get("https://www.google.com"); | |
// findElement | |
WebElement serachTxtBox = driver.findElement(By.name("q")); | |
//findElements | |
List<WebElement> allLinks = driver.findElements(By.tagName("a")); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment