Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, windows and java based applications. Get your 30 day free trial.

Discuss your Sahi Pro usage patterns, best practices, problems and solutions. Help others solve their problems and seek help from the community when needed. If you need specific support on your application, please email support @ sahipro.com

Cannot find _button("foo", _in(_div("bar"))) with more than 3 nesting levels

felixlufelixlu Members
edited September 2014 in Sahi - Open Source
For example, the DOM tree looks like this:
<div class="x-panel-mc-bwrap" id="ext-gen12">
  <div class="x-panel-mc-footer x-panel-mc-footer-noborder" id="ext-gen14">
    <div class="x-panel-btns-ct" id="ext-gen518" style="">
      <div class="x-panel-btns x-panel-btns-center" style="" id="ext-gen889">
        <table cellspacing="0"><tbody><tr>
          <td class="x-panel-btn-td" id="ext-gen15">
            <table border="0" cellpadding="0" cellspacing="0" class="x-btn-wrap x-btn x-btn-text-icon " id="ext-comp-1053" style="width: auto;"><tbody><tr>
              <td class="x-btn-left"><i>&nbsp;</i></td>
              <td class="x-btn-center" id="ext-gen520" style=""><em unselectable="on">
                <button class="x-btn-text" type="button" id="ext-gen17" style="background-image: url(http://my-domain.com/path/to/image/search.png);">Search</button>
              </em></td>
              <td class="x-btn-right" id="ext-gen550"><i>&nbsp;</i></td>
            </tr></tbody></table>
          </td>
          <td class="x-panel-btn-td" id="ext-gen23">
            <table border="0" cellpadding="0" cellspacing="0" class="x-btn-wrap x-btn x-btn-normal " id="ext-comp-1054" style="width: auto;"><tbody><tr>
              <td class="x-btn-left" id="ext-gen547"><i>&nbsp;</i></td>
              <td class="x-btn-center" id="ext-gen535"><em unselectable="on"><button class="x-btn-text" type="button" id="ext-gen25">Reset</button></em></td>
              <td class="x-btn-right"><i>&nbsp;</i></td>
            </tr></tbody></table>
          </td>
        </tr></tbody></table>
      <div class="x-clear"></div>
      </div>
    </div>
  </div>
</div>

Sahi can find the Search button when using:
_button("Search", _in(_div("ext-gen14")))
But it cannot find it when using:
_button("Search", _in(_div("ext-gen12")))
And it can find it again when using:
_button(0, _in(_cell("Search", _in(_div("ext-gen12")))))

Any body knows why does it happen? Is there any limitation of nesting levels in finding buttons inside some other elements (while not in finding cells)? Thanks a lot.

PS: I'm using the latest version of Sahi, the browser is IE8 on Windows 7, and my SUT is built with ExtJS 2.0.2.
Sign In or Register to comment.