Forum Discussion

mhienbinhphuoc_'s avatar
mhienbinhphuoc_
Occasional Contributor
12 years ago

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
  • mhienbinhphuoc_'s avatar
    mhienbinhphuoc_
    Occasional Contributor
    I resolved this problem.

    The cause is zoom of Chrome not 100%.

    Thanks for your support.



    Hien
  • mhienbinhphuoc_'s avatar
    mhienbinhphuoc_
    Occasional Contributor
    One more information about this problem.

    If I find button by name, error occurs at line of code call Click().



    createNewRuleBtn = page["NativeWebObject"]["Find"]("name", "btAddNewRule");

    createNewRuleBtn["Click"]();



    Error log as below:

    There was an attempt to perform an action at point (3, 0) which is invisible or out of the window bounds.



    Additional info:

    Tested object: Sys["Browser"]("chrome")["Page"]("http://devsite1.dsimobile.com/DsiMvc2/Compliance/settings#rules")["Section"]("main")["Panel"]("site_content")["Panel"]("mainContent")["Panel"](0)["Panel"]("elogRuleContainer")["Table"]("btAddNewRule")["Cell"](0, 0)["Link"]("btAddNewRule_CT")["Panel"](0)["Button"]("btAddNewRule")



    Thanks,

    Hien

  • Hi Hien,


     


    Calling the Click method without parameters clicks in the middle of the target object. Check whether the zoom of your browser window is set to 100%. It may affect the way the size of the button is calculated.

  • mhienbinhphuoc_'s avatar
    mhienbinhphuoc_
    Occasional Contributor
    Hi Tanya,



    I called Click method without parameter in the middle of target object:

    page["NativeWebObject"]["Find"]("id", "btAddNewRule_CT")["Click"]();



    The zoom of browser was 100%.

    However click action is performed on incorrect possition of button.



    Best regards,

    Hien
  • mhienbinhphuoc_'s avatar
    mhienbinhphuoc_
    Occasional Contributor
    One more information for this problem:

    Before website was modified, Click() this button ran correct.

    After website was modified, this issue occurs although attributes of this button was not changed.



    Thanks,

    Hien

  • Hi Hien,


     


    However click action is performed on incorrect possition of button.


    Where is the click performed?


     

  • weototheheo's avatar
    weototheheo
    Occasional Contributor
    Click is performed on a possition beside button.



    This issue occurs on all controls (button, text input, link,..) on my webpage.

    Test script is execute of Chrome v32.0.1700.107 m.

    I downloaded chrome dispatch but it can't resolved.



    Thanks,

    Hien