<!--Manufacturer Tab--> <telerik:RadTabItem DropDownContent="Manufacturers" Header="Manufacturers" FontSize="14" Background="Transparent" Padding="20,0,20,0"> <telerik:RadTabItem.Content> . . . . </telerik:RadTabItem.Content> </telerik:RadTabItem>[TestMethod]public void UIChecks (){ _RadComboBox CB_Boundary = myApp.FindName<RadComboBox>("CB_Boundary"); Assert.IsNotNull(CB_Boundary); Sleep(1); // Don't know how to click on RadComboBoxItems, this maybe? CB_Boundary.User.Click(); //ArgumentException //ComboBox contains no items to search in and select! Please make sure the test case opens CB_Boundary.SelectItem("Boundry", true); //Select Boundry Item Sleep(1);}[TestMethod()]public void CheckAllTabs(){ //Elements _HyperlinkButton btnMap = myApp.FindName<HyperlinkButton>("btnMap"); System.Threading.Thread.Sleep(3500); btnMap.User.Click(); System.Threading.Thread.Sleep(3500); TestErrorPage(); System.Threading.Thread.Sleep(3500); myManager.ActiveBrowser.NavigateTo("http://localhost:1314/MSP/default.aspx#lul"); System.Threading.Thread.Sleep(3500); TestErrorPage();}//Checks for popup error Messagepublic void TestErrorPage(){ FindStrategy originalStrategy = myApp.Popups.FirstOrDefault().VisualTree.Find.Strategy; try { myApp.RefreshVisualTrees(); System.Threading.Thread.Sleep(3500); //null reference exception occurs myApp.Popups.FirstOrDefault().VisualTree.Find.Strategy = FindStrategy.WhenNotVisibleReturnNull; Button OKButton = myApp.Popups.FirstOrDefault().VisualTree.Find.ByName<Button>("OKButton"); Assert.IsNull(OKButton); } finally { myApp.Popups.FirstOrDefault().VisualTree.Find.Strategy = originalStrategy; }}<div class="popup-modal most-visible" style="display: block; z-index: 102; width: auto; height: auto; top: 159px; left: 680px;"><div class="qsc-popup-dialog" style="display: block; visibility: visible;"><div class="close-button" title="Close Dialog"></div><div class="header">Product Type</div><div id="startupHelp" class="body" style="width: auto; height: auto; overflow: auto;"><div class="footer"></div></div><div class="sf-pagehelp" style="left: 0px;"><a class="sf-pagehelp-pin" href="#" style="display: none;"></a><div class="sf-pagehelp-hdr"><h3>Page Help</h3><div class="sf-pagehelp-subtext">Quick answers for the current page.</div></div><div class="sf-pagehelp-wrap"><div class="sf-pagehelp-toggle"></div></div>
I think i'm having issues because the code will always be in the source so what i'm trying now will never be false...
browser.RefreshDomTree();
//if help is open close it.
if (browser.Find.ById("sf-pagehelp") != null)
{
browser.Actions.Click(browser.Find.ById("sf-pagehelp-toggle"));
}
else if (browser.Find.ByXPath("/html/body/div[3]/div/div[4]/div/span/a/span/span/input") != null)
{
browser.Actions.Click(browser.Find.ByXPath("/html/body/div[3]/div/div[4]/div/span/a/span/span/input"));
}
any help is appreciated.
thanks! I have a question regarding the genericDialog in Silverlight application. I have the following scenario:
If I launch the Silverlight Application and the genericDialog appears (it means the error appears), the test fails; if not, the test passes.
Telerik Test Studio Generates the following code:
GenericDialog genericDialog = new GenericDialog(ActiveBrowser, "", true, "");
genericDialog.ButtonId = 2;
Manager.DialogMonitor.AddDialog(genericDialog);
ActiveBrowser.NavigateTo("testurl");
genericDialog.WaitUntilHandled(5000); ----how to handle this one using if else condition?
Do you have any idea about how to use if else condition in genericDialog.WaitUntilHandled(5000)?
Thanks so much!