Created
February 18, 2021 06:34
-
-
Save ultimate-qa2/39c13a38ff7590b9d17dc4009f9e66ee to your computer and use it in GitHub Desktop.
CSS Selectors in Java
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
// css ID | |
driver.findElement((By.cssSelector("#user-name"))); | |
// Input elemenet with class form_input | |
driver.findElement(By.cssSelector("input.form_input")); | |
// Direct child | |
driver.findElement(By.cssSelector("form > input")); | |
// using attribute. Input with id='user-name' | |
driver.findElement(By.cssSelector("input[id='user-name']")); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment