Hi,
I have a page that contains a RadAjaxPanel, i am trying to write test code to validate the contents of a list that is async loaded in the ajaxPanel.
Here is the basic structure of my page and UserControls:
default.aspx
ahp.
ahp.
So I am trying to find all the HtmlAnchors that are rendered by the
But the linksInPanel Never contains the elements that are actually displayed.
Here is my test code
Is this a limitation caused by the dynamically loaded markup in the ajaxPanel?
Or am i just not looking for my links in the right way?
Thanks for any help,
Daniel
delofer@aptilon.com
I have a page that contains a RadAjaxPanel, i am trying to write test code to validate the contents of a list that is async loaded in the ajaxPanel.
Here is the basic structure of my page and UserControls:
default.aspx
<
telerik:RadAjaxPanel
ID
=
"ajaxPanel_Activities"
runat
=
"server"
EnableAJAX
=
"true"
LoadingPanelID
=
"loadingPanel_Activities"
RequestQueueSize
=
"1"
>
<
div
>
<
ahp:ActivitiesTabPanel
runat
=
"server"
ID
=
"activitiesTabPanel"
/>
</
div
>
</
telerik:RadAjaxPanel
>
ahp.
ahp:ActivitiesTabPanel
UserControl<
div
class
=
"wideColumn"
>
<
telerik:RadMultiPage
ID
=
"radMultiPage_ActivitiesLists"
runat
=
"server"
SelectedIndex
=
"0"
>
<
telerik:RadPageView
ID
=
"radPageView_ActivitiesListLive"
runat
=
"server"
>
<
ahp:ActivitiesList
ID
=
"activitiesList_Live"
runat
=
"server"
NumberOfResults
=
"0"
ReferenceActivityGroupName
=
"Activities Page - Lives"
OnMouseOver
=
"showActivityContent('{0}', '{1}', '{2}');"
OnMouseOut
=
"startTimer();"
/>
</
telerik:RadPageView
>
</
telerik:RadMultiPage
>
<
div
>
ahp.
ahp:ActivitiesList
UserControl<
asp:Repeater
ID
=
"rptActivities"
runat
=
"server"
OnItemDataBound
=
"rptActivities_ItemDataBound"
>
<
ItemTemplate
>
<
asp:LinkButton
ID
=
"linkTopic"
runat
=
"server"
Text='<%# Eval("Topic") %>' CommandName="Click" CommandArgument='<%# Eval("ActivityId") %>' OnCommand="activityLink_Command" />
</
ItemTemplate
>
</
asp:Repeater
>
So I am trying to find all the HtmlAnchors that are rendered by the
ahp:ActivitiesList
UserControl.But the linksInPanel Never contains the elements that are actually displayed.
Here is my test code
HtmlDiv ajaxPanel = _manager.ActiveBrowser.Find.ById<HtmlDiv>(
"ctl00_ctl00_cphContent_plcContent_ajaxPanel_Activities"
);
Thread.Sleep(3000); //Give time for ajaxPanel to load.
ReadOnlyCollection<HtmlAnchor> linksInPanel =ajaxPanel.Find.AllByTagName<HtmlAnchor>(
"a"
);
HtmlAnchor match =
null
;
foreach
(HtmlAnchor ank
in
linksInPanel )
{
if
(activities.ActivityTarget[0].Topic.ToLower().Trim() == ank.BaseElement.InnerText.ToLower().Trim())
{
match = ank;
break
;
}
}
Assert.IsTrue(match !=
null
);
Is this a limitation caused by the dynamically loaded markup in the ajaxPanel?
Or am i just not looking for my links in the right way?
Thanks for any help,
Daniel
delofer@aptilon.com