I have class name active and then there is unique text called active text in span(which is nested). Class name active is the unique among other class names then nested text is unique. How would i click on that. I have used following methods.
FindElement(By.XPath("//li[@class='active']//*[contains(.,'active text')]"));
also i tried
findelement(BY.xpath(//li[@class='active']//div//div//div//span[contains(.,'active text')]"))
also tried this
FindElement(By.XPath("//li[contains(@class,'active')] and //span[contains(.,'active text')]")).Text;
Every time i get no such element found ANythoughts this is the html code
<li class="active">
<div class="a">
<div class="b">
<div class="c">
<h1></h1>
<h3 class="d"> some text</h3>
<div class="e">
<span class="f">
Active Text</span>
</div></div></div></div>
</li>