I have tried to use CSS Selector with contains()
in selenium webdriver, but I'm facing NullPointerException
.
Can someone please help?
private static final String testcode = "p:contains('Notes')";
public String getTextCode(String codes) throws Exception {
String jc = driver.findElement(By.cssSelector(codes)).getText();
return jc;
}