[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
Any ideas(via code) how to scroll when combobox has been clicked and result set is not entirely visible?
Example.
I have a combobox that has 30 items and only the first 10 show without scrolling. In my coded test I have a loop that clicks on the combo box and checks if the item exists via find.byText. When looping through, it looks for items that are visible and keeps moving, If it cant find the item it hits the catch via timeout and I get my predefined error. Problem is it cant find items in the combobox that show only when the combobox is scrolled down. ANy ideas?
Code for example:
foreach
(PressImposition checkProd in Products)
{
try
{
//Select Product Dropdown
Pages.MMSPlugins_0.SilverlightApp.Item0Combobox.User.HoverOver();
Pages.MMSPlugins_0.SilverlightApp.Item0Combobox.User.Click();
TextBlock select = Pages.MMSPlugins_0.SilverlightApp.Item0Combobox.Find.ByText(checkProd.OfferingDisplayName);
select.User.HoverOver();
select.User.Click();
}
catch
{
Assert.Fail("Test Failed to Find Imposition Product");
}
}
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN" "http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd"> |
<html xmlns="http://www.w3.org/1999/xhtml"> |
<head> |
<title> |
Test |
</title> |
</head> |
<body> |
<table> |
<tbody> |
<tr> |
<td> |
<table> |
<tbody> |
<tr> |
<td /> <!-- the problem cell --> |
<td id="td2">cell 1,1,1,2</td> |
</tr> |
</tbody> |
</table> |
</td> |
</tr> |
<tr> |
<td id="td3">cell 2,1</td> |
</tr> |
</tbody> |
</table> |
</body> |
</html> |
<body> |
<table> |
<tbody> |
<tr> |
<td> |
<table> |
<tbody></tbody> |
</table> |
</td> |
<tr> |
<td> |
<td id='td2'></td> |
</td> |
</tr> |
</tr> |
</tbody> |
</table> |
<tr> <!-- ROW slipped out of outer table --> |
<td id='td3'></td> |
</tr> |
</body> |