How to get the count of the matching element count

2 posts, 0 answers
  1. duggirala
    duggirala avatar
    3 posts
    Member since:
    Oct 2014

    Posted 13 Nov 2014 Link to this post

    I need to get the count of the number of text fields with attribute id = 'getcount' . My page has n number of text fields and i should fill the all the fields having id attribute as 'getcount'. Any help is highly appreciated.


  2. Cody
    Cody avatar
    3354 posts

    Posted 18 Nov 2014 Link to this post

    Hello Avinash,

    You will need to do this in code. Here's how to get started:
    IList<HtmlInputText> inputs = ActiveBrowser.Find.AllByExpression<HtmlInputText>("id=getcount");
    foreach (HtmlInputText anInput in inputs)
        // do something with the anInput variable here

    Quickly become an expert in Test Studio, check out our new training sessions!
    Test Studio Trainings
Back to Top