I am searching for something specific, from a dropdown and want to capture the error message when no results are found. The message to be displayed from the toaster is "No Records Found"
Try using the class name
String text = driver.findElement(By.className("toast-title")).getText();
or the XPath
String text = driver.findElement(By.xpath("//div[@ng-class=‘config.title’])).getText();
I think this is an angular application so you can try ngWebDriver ( a driver that implements protractor functionality) paul-hammant/ngWebDriver GitHub Link