How to count childNodes of a div

9 views
Skip to first unread message

SHAILENDRA SINGH

unread,
Sep 22, 2011, 4:45:24 AM9/22/11
to selenesse-users
Hi,

In a testcase , I have to count all the childNodes of a Div , and this
Div do not have 'Id' but it has a class.


eg.

<div class="searchCenter largeFont">

<div class="NewClass"> 1 </div>
<div class="NewClass"> 2 </div>
<div class="NewClass"> 3</div>
<div class="NewClass"> 4 </div>
<div class="NewClass"> 5</div>
</div>

I want to count childNodes of <div class="searchCenter largeFont"> ,
and result should be 5.

Thanks in advance, It's urgent please suggest some solution ASAP.

-Shailendra

Chris Dombroski

unread,
Sep 22, 2011, 7:41:05 AM9/22/11
to selenes...@googlegroups.com
You should be able to do something like this:
|check|get xpath count|//div[@class="searchCenter largeFont"]/*|5|
Reply all
Reply to author
Forward
0 new messages