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.

Accessor issue.

jonyxy777jonyxy777 Members
edited June 2013 in Sahi - Open Source
Hi,

I'm having an issue with the accessors of two elements.

Element 1. Checkbox

Instead of using the ID of the checkbox, this is what Sahi produces: _div("ui-chkbox-box ui-widget ui-corner-all ui-state-default")

The alternate accessor is this: _div(25)

Only using the alternate works. But why doesn't Sahi use its ID?

The following is the source code of the element:
<div id="cr1002_checkbox_quoteInEntCcy" class="ui-chkbox ui-widget selectBooleanCheckbox"><div class="ui-helper-hidden-accessible"><input id="cr1002_checkbox_quoteInEntCcy_input" name="cr1002_checkbox_quoteInEntCcy_input" type="checkbox" onchange="this.form.submit()" /></div><div class="ui-chkbox-box ui-widget ui-corner-all ui-state-default"><span class="ui-chkbox-icon ui-c"></span></div></div>

Element 2. A particular selection item of a drop down combo box

The drop down box has got 5 selection items, one of which is a blank selection, with which the problem lies.

Sahi produces: _listItem("ui-selectonemenu-item ui-selectonemenu-list-item ui-corner-all ui-state-highlight")
Alternate: _listItem(67)
Only using the alternate works.

The other selection items all have accessors containing their value which all work. E.g. _listItem("Act 360")
So why doesn't _listItem("") work?

Here's the code:
<div id="cr1002_combo_box_accrual_method" class="ui-selectonemenu ui-widget ui-state-default ui-corner-all ui-helper-clearfix selectOneMenu" style="background-color: #c9e9e2;"><div class="ui-helper-hidden-accessible"><select id="cr1002_combo_box_accrual_method_input" name="cr1002_combo_box_accrual_method_input"><option value=""></option><option value="21004">30/360</option><option value="21002">Act/360</option><option value="21003">Act/365 (Act)</option><option value="21001">Act/365 (fixed)</option></select></div><div class="ui-helper-hidden-accessible"><input id="cr1002_combo_box_accrual_method_focus" name="cr1002_combo_box_accrual_method_focus" type="text" /></div><label id="cr1002_combo_box_accrual_method_label" class="ui-selectonemenu-label ui-inputfield ui-corner-all"> </label><div class="ui-selectonemenu-trigger ui-state-default ui-corner-right"><span class="ui-icon ui-icon-triangle-1-s"></span></div><div id="cr1002_combo_box_accrual_method_panel" class="ui-selectonemenu-panel ui-widget-content ui-corner-all ui-helper-hidden ui-shadow"><div class="ui-selectonemenu-items-wrapper" style="height:auto"><ul class="ui-selectonemenu-items ui-selectonemenu-list ui-widget-content ui-widget ui-corner-all ui-helper-reset"><li class="ui-selectonemenu-item ui-selectonemenu-list-item ui-corner-all" data-label="&nbsp;" title=""> </li><li class="ui-selectonemenu-item ui-selectonemenu-list-item ui-corner-all" data-label="30/360" title="">30/360</li><li class="ui-selectonemenu-item ui-selectonemenu-list-item ui-corner-all" data-label="Act/360" title="">Act/360</li><li class="ui-selectonemenu-item ui-selectonemenu-list-item ui-corner-all" data-label="Act/365 (Act)" title="">Act/365 (Act)</li><li class="ui-selectonemenu-item ui-selectonemenu-list-item ui-corner-all" data-label="Act/365 (fixed)" title="">Act/365 (fixed)</li></ul></div></div></div>


Thank you.
Sign In or Register to comment.