Hey Chummers,
I f***ing love this Framework!!
However, it seems that I am way to stupid to use it. :-D Hope you can help me out!
I am trying to click on a button, but always get a NotFoundException. So I wrote a small test containing the following code:
01.
var app = myManager.ActiveApplication.MainWindow;
02.
03.
app.Find.Strategy = FindStrategy.AlwaysWaitForElementsVisible;
04.
IList<FrameworkElement> buttonList = app.Find.AllByType(
"Button"
);
05.
06.
foreach
(var element
in
buttonList)
07.
{
08.
Debug.WriteLine(element.Name);
09.
}
The output is
PART_SysMinimizeButton
PART_SysMaximizeButton
PART_SysRestoreButton
PART_SysCloseButton
So it seems my code is only able to address the buttons in the Window-frame so far and I have no idea what do do...
Any suggestions?
Greetings Stephan
Assert.That(MyControl.Find.ByName("valueTextBlock").As<
TextBlock
>().Text, Is.EqualTo("Football"));
Assert.That(MyControl.Find.AllByType<
TextBlock
>()[1].Text, Is.EqualTo("Football"));
Hello,
There are 2 grids, one is used to find personnel, the other one is used to find divisions in which the personnel works
The same testing pattern applies to both grids: open the grid, type info in one or several input boxes and select a result. The first grid works fine, however, when using the second grid, it sometimes selects the first result from the list right after opening the grid. And I mean SOMETIMES, because sometimes sets the text in the input box, presses enter and then selects the wanted results, and sometimes it just selects the first result RIGHT AFTER opening the grid.
I'd like to know what could be the reasons that are causing this.
Thanks in advance.
private
readonly
DialogMonitor _dialogMonitor;
public
void
HandleUploadDialog(
string
path, HtmlInputFile controll)
{
var dialog =
new
FileUploadDialog(Manager.Current.ActiveBrowser, path, DialogButton.OPEN);
_dialogMonitor.Start();
_dialogMonitor.AddDialog(dialog);
controll.Click();
dialog.WaitUntilHandled(10000);
}
I attached a screenshot as an example of frozen window
Could you suggest me a solution? What could be a reason of such behavior? Is there any other way to handle this dialog?
Hi Team,
I'm trying to automate silverlight application using Telerik testing framework . I've explored and created a sample scenario on silverlight application and executed perfectly on Internet Explorer but not in Firefox (version 40.0)
While I'm executing the same script its navigating to application and throws runtime error "Timeout trying to connect to silverlight application" here "SilverlightApp app = ActiveBrowser.SilverlightApps()[0];"
I've done the workaround on the issue and found following solutions but unfortunately couldn't able solve my problem
1. Cleared the Firefox browser cache
2. added hardcoded sleeps, waits, refreshDOM and waituntilready
3.added Settings.Current.Web.EnableSilverlight = true; before launching the browser
Below is my code
[Test]
public void SilverlightCRM()
{
Settings.Current.Web.EnableSilverlight = true;
Manager.LaunchNewBrowser(BrowserType.FireFox);
ActiveBrowser.NavigateTo("http://demos.telerik.com/silverlight/crm/");
ActiveBrowser.WaitUntilReady();
ActiveBrowser.RefreshDomTree();
System.Threading.Thread.Sleep(50000);
SilverlightApp app = ActiveBrowser.SilverlightApps()[0];
ActiveBrowser.WaitUntilReady();
ActiveBrowser.Window.Maximize();
//app.Find.ByTextContent("companies").Wait.ForExists();
// app.Find.ByTextContent("companies").User.Click();
System.Threading.Thread.Sleep(5000);
ActiveBrowser.RefreshDomTree();
ActiveBrowser.WaitUntilReady();
app.Find.ByExpression(new XamlFindExpression("XamlTag=contentcontrol","name=MainMenuRegionPlaceholder","|",
"XamlPath=/contentpresenter[0]/mainmenuview[0]/grid[name=LayoutRoot]/stackpanel[0]/radradiobutton[1]")).User.Click(); //click on company
ActiveBrowser.WaitUntilReady();
System.Threading.Thread.Sleep(50000);
app.Find.ByAutomationId("AddNew").Wait.ForExists();
System.Threading.Thread.Sleep(5000);
//app.Find.ByExpression(new XamlFindExpression("XamlTag = radbutton", "AutomationId = AddNew")).Wait.ForVisible();
// app.Find.ByExpression(new XamlFindExpression("XamlTag = radbutton", "AutomationId = AddNew")).User.Click() ; //click on ADD
// app.Find.ByAutomationId("AddNew").User.Click(); //Click on ADD
System.Threading.Thread.Sleep(5000);
// app.Find.ByName("PART_FieldsContentPresenter").User.Click(); //enter text in description field
// app.Find.ByName("PART_FieldsContentPresenter").User.TypeText("telerik",10);
//app.Find.ByExpression(new XamlFindExpression("XamlTag=contentpresenter", "name=PART_FieldsContentPresenter1", "|", "XamlTag=TextBoxView")).User.Click(); //click on field
// app.Find.ByExpression(new XamlFindExpression("XamlTag=contentpresenter", "name=PART_FieldsContentPresenter1",
// "|", "XamlTag=TextBox")).User.TypeText("srkjasdn", 10); //enter text in field
app.Find.ByName("ContentElement").User.Click(); //click on compnay field
app.Find.ByName("ContentElement").User.TypeText("telerik", 10); //enter text in company field
}
Please let me know if there is any other way to resolve this issue or am I need to add anything else , Thanks in advance
Regards,
Deepak.
OK, absolute noob with Testing Framework. First thing I'm trying to do is find a checkbox control on our WPF UI:
System.Diagnostics.Process.Start(
"OurApplication.exe"
);
System.Diagnostics.Process[] appProcess = proc.GetProcessesByName(
"OurAppHost"
);
WpfApplication wpfApp = Manager.ConnectToApplication(appProcess[0]);
CheckBox chkClientExists;
chkClientExists = wpfApp.MainWindow.Find.ByAutomationId<CheckBox>
"Existing_Client_Checkbox"
);
Running in debug mode, that last line fails with "Wait for condition has timed out" error. Looks like:
System.TimeoutException was unhandled
HResult=-2146233083
Message=Wait
for
condition has timed
out
Source=ArtOfTest.WebAii
StackTrace:
at ArtOfTest.Common.WaitSync.CheckResult(WaitSync wait, String extraExceptionInfo, Object target)
at ArtOfTest.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout, WaitResultType errorResultType)
at ArtOfTest.WebAii.Silverlight.VisualWait.ForExistsInternal(Int32 timeout, Boolean invertCondition)
at ArtOfTest.WebAii.Silverlight.VisualWait.ForExists(Int32 timeout)
at ArtOfTest.WebAii.Silverlight.VisualWait.ForVisible(Int32 timeout)
at ArtOfTest.WebAii.Silverlight.VisualFind.ReturnOrThrow(FrameworkElement e, String throwMessage)
at ArtOfTest.WebAii.Silverlight.VisualFind.ByAutomationId(String id, String xamlTag)
at ArtOfTest.WebAii.Silverlight.VisualFind.ByAutomationId[T](String id)
InnerException:
But if then, while execution is suspended, I copy and paste that line into the Immediate window and execute it there, it returns the checkbox instantly and I'm able to examine all its properties and its children in Locals and Watch.
I have no trouble locating this control in OOB Coded UI by AutomationID, but it's a custom control and there are no properties visible to Coded UI by which we can determine its state. That seems to be determined by child elements (XAML Ellipses apparently) that Coded UI is unable to see. Testing Framework IS able to see them, IF I can get the parent, and I don't seem to be able to get the parent for some reason. At least not in executing code.
Help?
ddk