Selenium findElement By.css
1 answer
To identify a node:
div class="md-tile-text--primary md-text">Getting Started
You can use the following cssSelector
:
driver.findElement(By.cssSelector("div.md-tile-text--primary.md-text"));
To build cssSelector
from text Getting Started
, you can use:
driver.findElement(By.cssSelector("div:contains('Getting Started')"));
+1
source to share