Not able to find the control on page, since there are contorls with same id's

5 posts, 0 answers
  1. Mahendra Kumar
    Mahendra Kumar avatar
    17 posts
    Member since:
    Feb 2010

    Posted 19 Sep 2011 Link to this post

    Hi All,

    I am using" WebAii_Testing_Framework_2010_3_1421" edition for automation.

    I have a page (basically Rad Window) where there are html controls with same Id's.
    I trying to find the HTML TABLE with attribute id=tasks and always it used to return null and hence failing the test.
    I dig in more to find the cause for failure and found that there is one more control which is hidden with the same id=task , but it is not a HTML TABLE but it is a anchor <A>.

    I have my code to look only for HTML TABLE to look specific id=task, but script fails. Not sure why is it failing since written code to only look for HTML TABLE. As per my understanding it should not look other than the <T> specified. But it seems that WebAii stops finding the required control at the 1st nearer match ( irrespective of the <T> specified) and do not it finds further.

    page.Find.ById<HTMLTABLE>("tasks")
    also I tried with
    page.Find.ByExpression<HTMLTABLE>(HtmlExpersion)
    I tried by constructing the regular expression for HtmlExpression wih various combinations(~, ! , | and different attributes), but not luck.
    If any one have come across the issue, let me know the workaround.

    Any suggestion are most welcome :)
    Thanks in Advance,
    Mahendra
  2. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 20 Sep 2011 Link to this post

    Hi Mahendra Kumar,

    Try this line of code and let us know if it works:

    page.Find.ByExpression<HTMLTABLE>("tagname=table", "id=task")

    Do you know whether or not this table is contained within an <iframe> under the page? if it is you need to access the frame element first.

    Best wishes,
    Cody
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  3. Mahendra Kumar
    Mahendra Kumar avatar
    17 posts
    Member since:
    Feb 2010

    Posted 20 Sep 2011 Link to this post

    Do you know whether or not this table is contained within an <iframe> under the page? if it is you need to access the frame element first.


    Yes, it is inside the Iframe and have accessed it by iframe.

    Thanks for the suggestion, I will try that let you know

    Regards,
    Mahendra
  4. Mahendra Kumar
    Mahendra Kumar avatar
    17 posts
    Member since:
    Feb 2010

    Posted 20 Sep 2011 Link to this post

    hi,
    Thanks a Lot that worked.

    Regards,
    Mahendra
  5. Cody
    Admin
    Cody avatar
    3354 posts

    Posted 20 Sep 2011 Link to this post

    Hello Mahendra Kumar,

    Wonderful news. Thank you for the update.

    Best wishes,
    Cody
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top