18 January 2026:


This forum is now archived and is in read-only mode. Please continue discussions on our improved new Sahi Pro Community forum.



Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.

How to Find Table Inside Div

shahparthshahparth Members
edited November -1 in Sahi - Open Source
Dear All,

I have the one table which is inside one div element.

That div element has its properties but table don't have any table-id or table-name.

In code, line number 3 " <table summary=""> " that table i want to use..

So, How can I get that table access ?

<div id="DataTable" class="yui-dt" align="center">
<div class="yui-dt-mask" style="display: none;"></div>
<table summary="">
<colgroup>
<col>
<col>
<col>
<col>
<col>
</colgroup>
<thead>
<tr class="yui-dt-first yui-dt-last">
<th id="yui-dt0-th-" class="centerColumn selectColumn yui-dt0-col- yui-dt-col- yui-dt-first" rowspan="1" colspan="1">
<div id="yui-dt0-th--liner" class="yui-dt-liner">
<span class="yui-dt-label">
<div id="" class="checkBox" style="width: 0px; float: none;">
<input id="check1" type="checkbox" name="check1" style="visibility: hidden; position: absolute; left: -999999px;" value="on">
<input type="hidden" style="left: -9999px; position: absolute;" disabled="" value="selectall();">
</div>
</span>
</div>
</th>
<th id="yui-dt0-th-name" class="yui-dt0-col-name yui-dt-col-name yui-dt-sortable" rowspan="1" colspan="1">
<div id="yui-dt0-th-name-liner" class="yui-dt-liner">
<span class="yui-dt-label">
<a class="yui-dt-sortable" title="Click to sort ascending" href="yui-dt0-href-name">
<div style="width: 90px;">
<div style="float: left; margin-top: 3px;">
<label id="AppFilterPolicyManage.Name">
<a xmlns="http://www.w3.org/1999/xhtml">Name</a>
</label>
</div>
<div id="btnFilteruser" class="columnFilter" onclick="openFilter(this,'name','AppFilterPolicyManage.Name','1',appFilterDataSource,appFilterRequestBuilder,appFilterDataTable);" title="Click to Filter"></div>
</div>
</a>
</span>
</div>
</th>
<th id="yui-dt0-th-defaultaction" class="yui-dt0-col-defaultaction yui-dt-col-defaultaction yui-dt-sortable" rowspan="1" colspan="1">
<div id="yui-dt0-th-defaultaction-liner" class="yui-dt-liner">
<span class="yui-dt-label">
<a class="yui-dt-sortable" title="Click to sort ascending" href="yui-dt0-href-defaultaction">
<label id="AppFilterPolicyManage.DefaultAction">Default Action</label>
</a>
</span>
</div>
</th>
<th id="yui-dt0-th-description" class="yui-dt0-col-description yui-dt-col-description" rowspan="1" colspan="1">
<div id="yui-dt0-th-description-liner" class="yui-dt-liner">
<span class="yui-dt-label">

Comments

  • You could always refer to the table by index. ie _table(0) is the first table on the page.

    Combining that with the Dom Relations functions, you can say it is near or in another element.
    You can locate the enclosing div with _div("DataTable"). and say it is the first table within that:
    Resulting locator:
    _table(0, _in(_div("DataTable")))
    
Sign In or Register to comment.