Hi I am checking that the text in an element to ensure its displaying the expected text..
The test fails as it says it returns "" but when I run it in debug it gets the correct text. I have added in a thread.sleep(5000) and this fixes the test (im not sure why?) and gets the displayed text but is there a better way of doing it as id prefer not to use sleep if possible.
IWebElement panel = _driver.FindElement(By.Id(currentPanel));
panel.FindElement(By.Id("middlepanel-showbtn")).Click();
displayedBody = panel.FindElement(By.Id("middlepanel-body"));
Thread.Sleep(5000);
displayedBodyText = displayedBody.Text;