I tried this way:
IWebElement descriptionTextXPath = driver.FindElement(By.XPath("html/body/div[1]/div[1]/div[2]/div/ng-include[1]/section/ul/li[1]/div/div/article/h4"));
String h4 = descriptionTextXPath.Text;
Assert.AreEqual("Controle\n" + "Básico", h4);
Return:
Message:Assert.AreEqual.Failed
Expected:<Controle Básico>.Atual:<Controle Básico>
The purpose is to state that "Basic Control" exists on the screen. Here is the html structure where you are:
<h4 class="simulation-plan-name ng-binding">
Controle
<span class="simulation-plan-type ng-binding">Básico</span>
</h4>
I tried to be as clear as possible, can you please help me?