18 January 2026:
Sahi Pro is an enterprise grade test automation platform which can automate web, mobile, API, windows and java based applications and SAP.
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.
Issue of DOM relations use
Hi,
I am testing adempiere via sahi.write scripts as follow and ues DOM relations.
part of login scripts:
the lastest step for confirm if image "spacer.gif" exists or not.
my reslult is "error".so problem happened because of wrong script "_image("spacer.gif",_near(_span("Language")))"
html codes:
I don't know how to ues DOM relations accurately.Please help me.
Addition: adempiere base on ZK,the element's id is dynamic.so can't use id as Identifier .
Regards,
sunny
I am testing adempiere via sahi.write scripts as follow and ues DOM relations.
part of login scripts:
_setValue(_textbox(0), "SuperUser");
_assertEqual("SuperUser",_getText(_textbox(0)));
_setValue(_password(0), "System");
_assertEqual("System",_getText(_password(0)));
if(_condition(_exists(_image("spacer.gif",_near(_span("Language"))))))
{
_log("success");
}else{
_log("error");
}
the lastest step for confirm if image "spacer.gif" exists or not.
my reslult is "error".so problem happened because of wrong script "_image("spacer.gif",_near(_span("Language")))"
html codes:
<tr id="rowLanguage">
<td id="z_cc_k" class="login-label">
<span id="z_cc_l" class="z-label" z.zcls="z-label" class="z-label">Language</span>
</td>
<td id="z_cc_m" class="login-field">
<span id="z_cc_n" class="z-combobox" style="width:220px;" z.zcls="z-combobox" z.onSelect="true" z.aco="true" z.adr="true" z.type="zul.cb.Cmbox" z.combo="true">
<table border='0' cellspacing='0' cellpadding='0' width='220px' style='display:inline-block'>
<tr style='white-space:nowrap; border:none220px'>
<td style='width: 100%; border:none'>
<input id="z_cc_n!real" autocomplete="off" class="z-combobox-inp" value="English" type="text" style='width: 100%'/>
</td>
<td style='width: 17px'>
<span id="z_cc_n!btn" class="z-combobox-btn" style="margin-left:2px">
<img class="z-combobox-img" onmousedown="return false;" src="/webui/zkau/web/8914214/img/spacer.gif""/>
</span>
</td>
</tr>
</table>...
I don't know how to ues DOM relations accurately.Please help me.
Addition: adempiere base on ZK,the element's id is dynamic.so can't use id as Identifier .
Regards,
sunny
Comments
my old script image(1) is the same as "spacer.gif",but i don't want to use scripts like "_image(1)", "_cell("Standard[5]")"...
tested with Assertion Failed.
ADempiere Online Demonstration:http://www.testadempiere.com/webui/
Result:
Now the assertion gets "success"
but why the test of next step is failed?
But I can explain the last error.
_condition returns true or false.
so _condition() != null will always be true. That is why you got success.
Thank you!
you can test Adempiere by:ADempiere Online Demonstration:http://www.testadempiere.com/webui/
Regards,
sunny