This is a migrated thread and some comments may be shown as answers.

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

4 Answers 74 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Mahendra Kumar
Top achievements
Rank 1
Mahendra Kumar asked on 20 Sep 2011, 12:56 AM
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

4 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 20 Sep 2011, 01:32 PM
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.
0
Mahendra Kumar
Top achievements
Rank 1
answered on 20 Sep 2011, 01:37 PM

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
0
Mahendra Kumar
Top achievements
Rank 1
answered on 20 Sep 2011, 03:51 PM
hi,
Thanks a Lot that worked.

Regards,
Mahendra
0
Cody
Telerik team
answered on 20 Sep 2011, 05:17 PM
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.
Tags
General Discussions
Asked by
Mahendra Kumar
Top achievements
Rank 1
Answers by
Cody
Telerik team
Mahendra Kumar
Top achievements
Rank 1
Share this question
or