I want get text of role=alert from HTML page, I can find the element but I'm not able to get the text.
<div class="alert alert-danger no-margin" role="alert">
customer.dashboard.InvalidCode
To find the element I used:
driver.FindElement(By.XPath("//div[contains(@class, 'alert')]"));
but if I try to get "customer.dashboard.InvalidCode" every time I get empty string.