Below is the element and I need to find the class names matching with the first css-
and ending with widget
, How do i find it in selenium (java)?
Tried with the below code, but it didnt work
List<WebElement> list1 = driver.findElements(By.xpath("//body[starts-with(@class, 'css-')]"));
List<WebElement> list2 = driver.findElements(By.xpath("//body[contains(@class, 'css-')]"));
List<WebElement> list3 = driver.findElements(By.xpath("//body[ends-with(@class, 'widget')]"));