Forum Discussion

william_roe's avatar
william_roe
Super Contributor
11 years ago

Setting the 'text' property of DevExpress Spinner control in script works in FireFox but not Chrome or IE

We have a DevExpress spinner control within a DevExpress grid. The spinner control is named by DevExpress based on the id of the row. I've written the following code which works in FireFox but doesn't work in Chrome or Internet Explorer. Internet Explorer fails when attempting to reference row[1].cells[24] and doesn't actually reach the 'spinner.text' line of code.




//


// SETS ORDER QUANTITY SPINNER FOR FILTERED ROW IN GRID


//


function SetOrderQuantity(value)


{


    // gets reference to browser


    var page = Sys.Browser().Page("*");


    


    // get reference to table


    var table = page.FindChildByXPath("//table[@id='grdAuthorize_DXMainTable']", true);


 


    // gets value of id


    var id = table.rows[1].cells[24].innerText;


    


    // gets reference to spinner input


    //id="spin747_I"


    var spinner = page.FindChildByXPath("//table[@id='grdAuthorize_DXMainTable']//input[@id='spin"+id+"_I']", true);


        


    if (spinner != null){


      spinner.text = value;


    }


    else{


      Log.Error("Could not locate auto purchase id '" + id + "'");


    }


}


  • Hi Keith,


     


    I guess TestComplete fails to find the spinner object after executing the FindChildByXPath method, right?


    Is it possible that the HTML structure of your test page is different in different browsers?


     

  • william_roe's avatar
    william_roe
    Super Contributor
    The control is found in Firefox and Chrome but setting the text property is not working in Chrome. I've tried using the 'SetText' method and still does not work in Chrome.





        if (spinner != null){


          //spinner.text = value;


          spinner.SetText(value);


        }


        else{


          Log.Error("Could not locate auto purchase id '" + id + "'");


        }


     


    IE is failing to find the object on the following ling:




        var id = table.rows[1].cells[24].innerText;