mhienbinhphuoc_
12 years agoOccasional Contributor
Click button is unavailable although button is existing
Hi all,
I created button by DevExpress.
I found button by id and call Click() button to open a form.
However click event is performed on incorrect position of button.
So expected form is not opened.
Please give me suggestion how to click on button.
Code of button is generated by DevExpress as below:
<table cellspacing="0" cellpadding="0" id="btAddNewRule" style="border-collapse:collapse;border-collapse:separate;-khtml-user-select:none;">
<tbody><tr>
<td><a href="#" id="btAddNewRule_CT" class="button blue-gradient devExButton checkFormCompile" style="margin:2px 2px;font-weight:normal;color:#fff;"><div style="border-width:0;width:0;height:0;opacity:0;padding:0;margin:0;overflow:hidden;">
<input value="" onfocus="aspxBGotFocus('btAddNewRule')" type="button" name="btAddNewRule" readonly="readonly" style="border-width:0px;height:0px;width:0px;padding:0;border-width:0;width:1px;height:1px;opacity:0;margin:0;position:relative;" class="button blue-gradient checkFormCompile">
</div><div id="btAddNewRule_CD" class="dxb">
<span>Create New Rule</span>
</div></a></td></tr>
</tbody></table>
Find button and call Click() as below many ways:
createNewRuleBtn = page["NativeWebObject"]["Find"]("id", "btAddNewRule_CD");
createNewRuleBtn["Click"]();
createNewRuleBtn = page["NativeWebObject"]["Find"]("id", "btAddNewRule_CT");
createNewRuleBtn["Click"]();
createNewRuleBtn = page["NativeWebObject"]["Find"]("id", "btAddNewRule");
createNewRuleBtn["Click"]();
Thanks,
Hien
I created button by DevExpress.
I found button by id and call Click() button to open a form.
However click event is performed on incorrect position of button.
So expected form is not opened.
Please give me suggestion how to click on button.
Code of button is generated by DevExpress as below:
<table cellspacing="0" cellpadding="0" id="btAddNewRule" style="border-collapse:collapse;border-collapse:separate;-khtml-user-select:none;">
<tbody><tr>
<td><a href="#" id="btAddNewRule_CT" class="button blue-gradient devExButton checkFormCompile" style="margin:2px 2px;font-weight:normal;color:#fff;"><div style="border-width:0;width:0;height:0;opacity:0;padding:0;margin:0;overflow:hidden;">
<input value="" onfocus="aspxBGotFocus('btAddNewRule')" type="button" name="btAddNewRule" readonly="readonly" style="border-width:0px;height:0px;width:0px;padding:0;border-width:0;width:1px;height:1px;opacity:0;margin:0;position:relative;" class="button blue-gradient checkFormCompile">
</div><div id="btAddNewRule_CD" class="dxb">
<span>Create New Rule</span>
</div></a></td></tr>
</tbody></table>
Find button and call Click() as below many ways:
createNewRuleBtn = page["NativeWebObject"]["Find"]("id", "btAddNewRule_CD");
createNewRuleBtn["Click"]();
createNewRuleBtn = page["NativeWebObject"]["Find"]("id", "btAddNewRule_CT");
createNewRuleBtn["Click"]();
createNewRuleBtn = page["NativeWebObject"]["Find"]("id", "btAddNewRule");
createNewRuleBtn["Click"]();
Thanks,
Hien