Q: Retrieve specific value by using Selenium C# code <div class="span9">
<div class="validation-summary-errors" data-valmsg-summary="true">
    <ul>
        <li>asdf</li>
        <li>dfg</li>
    </ul>
</div>


I would like to retrieve the value "dfg" in relation to selenium for unit testing by using C# code.
    IWebElement ddd = driver.FindElement(By.CssSelector("validation-summary-errors"));

    IList<IWebElement> ddd3d = driver.FindElements(By.XPath("//validation-summary-errors/ul/li"));

I have tried to retrieve the value but it doesn't work.
Thank you!
Info:
*In this context I cannot add any html, css or javascript code. cshtml because it is created automatically by asp.net mvc

A: I know nothing about IWebElement but on first glance I'd say that your xpath is incorrect,  try:   "//div/ul/li"

A: ddd3d.Last().Text does not work?

A: use the below code:
driver.FindElement(By.CssSelector("div.validation-summary-errors>ul>li:nth-child(2)")).Text;

this will return the string dfg. Hope this will help you.
