Forum Discussion

william_roe's avatar
william_roe
Super Contributor
9 years ago

Get All Input Elements on Screen via FindChildByXPath

I've used FindChildByXPath to find first TD with click event (see below) but how do I get all controls on a page of a certain types (i.e. TextBoxes, Images, Tables, etc)?     var page = Sys.Browser...
  • HKosova's avatar
    HKosova
    9 years ago

    Hi William,

     

    Sorry for the late reply. If by "disabled" you mean any of these:

     

    <input type="hidden" .../>
    <input type="text" disabled .../>
    <input type="text" readonly .../>
    

    then the query for enabled inputs shoud be something like:

     

    var arr = page.EvaluateXPath("//input[@type!='hidden' and not (@readonly or @disabled)]", true);