I trying to automate the Silverlight UI, It contains the tab structure the change tile textbox is in bydefault selected Tab , I am trying to access it (see the last line in test code which is Bold throws Exception.) but it throwing some exception the eeor messgae is as below
Exception thrown during the wait for a condition. Error: Unexpected error while waiting on condition.
Error: System.NullReferenceException: Object reference not set to an instance of an object.
at ArtOfTest.WebAii.Silverlight.VisualWait.WaitForExistsByFindInfo(VisualFindInfo findInfo)
at ArtOfTest.Common.WaitAsync._worker_DoWork[T,V](Object waitParam)
My Xaml file code snippet is like below
<TextBlock Grid.Row="0" Grid.Column="0" Style="{StaticResource TitleTextBlockStyle}"><Run Text="Change Title"/></TextBlock>
<TextBox x:Name="txt_Essentials_ChangeTitle" Grid.Row="0" Grid.Column="2" Margin="2">
</TextBox>
Below is my Test Code:
Settings mySettings = new Settings(BrowserType.InternetExplorer, @"D:\log\");
Manager myManager = new Manager(mySettings);
myManager.Start();
myManager.LaunchNewBrowser();
myManager.ActiveBrowser.NavigateTo("
http://ApplicationURL");
myManager.ActiveBrowser.WaitUntilReady();
SilverlightAppsList slvrApp = myManager.ActiveBrowser.SilverlightApps();
SilverlightApp app = slvrApp.GetApp(0);
app.FindName<
TextBox>("txt_Essentials_ChangeTitle").Text = "ArtOfTest did the trick";
Please Suggest me the solution I am stucked up here ...........!
| [TestMethod] |
| public void ChildWindowTest() |
| { |
| // |
| // TODO: Add test logic here |
| // |
| //Manager.Settings.ExecutionDelay = 10; |
| Manager.LaunchNewBrowser(BrowserType.InternetExplorer); |
| //System.Drawing.Point loc = ActiveBrowser.Window.Location; |
| ActiveBrowser.NavigateTo("http://localhost:1031/SampleSilverlightAppTestPage.aspx"); |
| ActiveBrowser.WaitUntilReady(); |
| SilverlightApp app = ActiveBrowser.SilverlightApps()[0]; |
| Assert.IsNotNull(app); |
| Button btnShowConfirmDialogue = app.Find.ByName<Button>("btnShowConfirmDialogue"); |
| Assert.IsNotNull(btnShowConfirmDialogue); |
| btnShowConfirmDialogue.User.Click(); |
| Thread.Sleep(2000); |
| app.RefreshVisualTrees(); |
| IList<ChildWindow> childWindows= app.Find.AllByType<ChildWindow>(); |
| ChildWindow myChildWindow = app.Find.ByName<ChildWindow>("ConfirmDialogueWindow"); |
| Button btnCancel = myChildWindow.Find.ByName<Button>("CancelButton"); |
| btnCancel.User.Click(); |
| } |
I have added Track method also in the Childwindow constructor
| public partial class ConfirmDialogue : ChildWindow |
| { |
| public ConfirmDialogue() |
| { |
| Telerik.WebUI.PopupTracker.Track(this); |
| InitializeComponent(); |
| } |
| private void OKButton_Click(object sender, RoutedEventArgs e) |
| { |
| this.DialogResult = true; |
| MessageBox.Show("Ok"); |
| } |
| private void CancelButton_Click(object sender, RoutedEventArgs e) |
| { |
| this.DialogResult = false; |
| MessageBox.Show("Cancel"); |
| } |
| } |
Below is the error i am getting
Test method WebAiiSample.WebAiiTest.ChildWindowTest threw exception: System.ApplicationException: Exception thrown during the wait for a condition. Error: Unexpected error while waiting on condition. Error: System.NullReferenceException: Object reference not set to an instance of an object.
at ArtOfTest.Common.TreeCrawler`3.ByExpression(T startNode, V expression, Boolean includeRoot)
at ArtOfTest.Common.TreeCrawler`3.ByExpression(T startNode, V expression)
at ArtOfTest.WebAii.Silverlight.VisualWait.WaitForExistsByFindInfo(VisualFindInfo findInfo)
at ArtOfTest.Common.WaitAsync._worker_DoWork[T,V](Object waitParam).
Hello Nelson,
thanks for replying all the tickets its very happy to glance u r response espcially the time out problem was solved.
iam sending one screen shot plez check it . The problem is when iam inserting any text in the textbox it is not recoginzed
upto the below sceenshot it is executing and giving the below exception
Unable to locate element. Details: Attempting to find [Silverlight] element using
Find logic
(Html): [id 'Exact' silverlightControlHost] THEN UNDER NODE FIND [tagIndex 'Exact' object:0]
(Silverlight): [XamlTag 'Exact' gridviewvirtualizingpanel] AND [automationid 'Exact' PART_GridViewVirtualizingPanel] THEN UNDER NODE FIND [XamlPath 'Exact' /gridviewrow[6]/grid[name=grid]/datacellspresenter[name=PART_DataCellsPresenter]/stackpanel[0]/horizontalscrollpanel[name=PART_PartialScrollContainer]/gridviewcellspanel[name=PART_GridViewCellsPanel]/gridviewcell[1]/grid[name=SelectionBackground]/alignmentcontentpresenter[name=PART_ContentPresenter]/grid[0]/hyperlinkbutton[0]]
iam using telerik with vsts
2)How many types of recording we have in telerik
Data grid object is static so not easy to select the values from grid what i have to do while selecting the static data in grid view
the time out exception is giving
thanks in advance
Dileep.s
Hello,
iam getting this problem can any one help me out of this problem
Unable to locate element. Details: Attempting to find [Silverlight] element using
Find logic
(Html): [id 'Exact' silverlightControlHost] THEN UNDER NODE FIND [tagIndex 'Exact' object:0]
(Silverlight): [TextContent 'Exact' TB122] AND [XamlTag 'Exact' textblock]
Unable to locate element. Search failed!
--------------------------------------------------
'6/22/2010 9:18:56 AM' - Detected a failure. Step is marked 'ContinueOnFailure=False' aborting test execution.
--------------------------------------------------
'6/22/2010 9:19:02 AM' - Overall Result: Fail
--------------------------------------------------
regards
Dileep