Hi,
I am using WebAii Automation Framework (2.0.7.0) to automate a web application which has Silverlight controls in it. I am caught up with a issue and hence need your help in resolving it.
I have a web page which has Telerik RadPanel in it. This is an expandable RadPanel. When I click on the RadPanel it expands and a Silverlight control is being loaded in this RadPanel. There is a hyperlink button which is loaded with this Silverlight control.
My use case is, I need to click on the hyperlink button.
[BLOCK 1] Here is the code that I have to expand the RadPanel.
MilestoneControl = Find.ById("panelBarMilestonesItem");
ITargetElement[] GetMilestoneTabs = MilestoneControl.GetChildren();
Element MilestoneTab = (Element)GetMilestoneTabs[0];
Actions.ScrollToVisible(MilestoneTab);
Manager.Settings.ExecutionDelay = 1000;
Actions.ScrollToVisible(MilestoneTab);
Actions.Click(MilestoneTab);
ActiveBrowser.WaitUntilReady();
Manager.Settings.ExecutionDelay = 1000;
Thread.Sleep(2000);
The above code gets the RadPanel to active screen/browser (visible to user) and expands the panel so that the Silverlight control is loaded.
[BLOCK 2] Here is the code through which I am trying to find the hyperlink button in the Silverlight control and click it.
try
{
app = ActiveBrowser.SilverlightApps()[1];
//string s = app.VisualTree.Root.ToXml();
app.FindName<HyperlinkButton>("hyperlinkAddMilestone").ScrollToVisible();
Manager.Settings.ExecutionDelay = 1000;
app.FindName<HyperlinkButton>("hyperlinkAddMilestone").EnsureClickable();
Manager.Settings.ExecutionDelay = 1000;
app.FindName<HyperlinkButton>("hyperlinkAddMilestone").User.Click();
Manager.Settings.ExecutionDelay = 1000;
}
The above code is followed by BLOCK 1 code. I have used both the methods ScrollToVisible() and EnsureClickable() to make sure that the element is visible or is available in the active screen to perform a user action. However these methods doesn’t bring the element to active screen and when Click() method is called there is an exception that raised. Here is the exception:
Exception:
Test method BgRoadmap.AddProductScript1.AddProduct threw exception: ArtOfTest.WebAii.Exceptions.LogErrorException: An error log has been detected. Error 'Could not load the Milestone ControlPoint (140, 1217) outside bounds of browser window: (0, 133, 1280, 843)'.
Can you please help me in resolving this issue. Thanks,
Regards,
Mithul.