c# - How to check if an element is actually holding some data -
my problem trying test if element present, able check if element holding data or empty.
the element searching :
<ul class="list-unstyled"> </ul>
obviously unordered list empty. how can check if holding data inside or not ? suggestions?
a)
supposing ul nodes via findelement, can search within iwebelement further findelements method.
var ulelements = driver.findelements(by.xpath("your xpath")); foreach (var ulelement in ulelements) { var contentelements = ulelement.findelements(by.cssselector("your css")); if (...) {} }
... or ... b)
please note can search xpath or cssselector. if choose search cssselector, can form css selector ul has @ least li. not selenium neither c#, recommend ask (ul has li) separate question , tag css selector infamous not exists in current css spec knows future brings
Comments
Post a Comment