Hi, hospital form guy here, searched and didn't find anything
Just wondering, is there any way to stop a test if any errors appear in the console? Like is there a way to check? And I mean any errors, not just JavaScript ones or anything like that. And I'm not talking about logging the errors, just stopping the test and showing the console errors.
Thanks in advance.
Hi ,
I am running few test scripts .Error i am getting is "element not found" for hyperlinkbutton,DataGrid,Listbox.I tried to find it by name as well as by type,but nothing works for me.I used silverlight spy to get the properties of the element.Attached is the details I got using silverlight spy.
Below is the details of error
<ErrorInfo>
<Message>Test method FF_TEST.FINDING threw exception:
ArtOfTest.Common.Exceptions.FindElementException: Element Not found!
FindExpression used:
[name 'Exact' dgProduct ]
</Message>
<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.ForVisible(Int32 timeout)
at ArtOfTest.WebAii.Silverlight.VisualFind.ReturnOrThrow(FrameworkElement e, String throwMessage)
at ArtOfTest.WebAii.Silverlight.VisualFind.ByName(String name)
at ArtOfTest.WebAii.Silverlight.VisualFind.ByName[T](String name)
</StackTrace>
</ErrorInfo>
my code is
var productGrid = app.Find.ByName<ArtOfTest.WebAii.Silverlight.UI.DataGrid>("dgProduct");
I tried below line as well
var productGrid = app.Find.ByName("dgProduct").As <DataGrid> () ;
it was noticed that productGrid variable is getting assigned with null value.
Similar issue is found with other controls like hyperlinkbutton ,listbox and label
Please guide me to solve this issue
Hi, hospital form guy here
Situation: every hospital form has the same header which uses the same piece of code for testing. I currently have 2 form tests written. Problem is, the same code is copy-pasted in both tests. If I want to make changes to the header code, I have to change it in every test, which is not very convenient.
Situation that would be useful:
1. Launch test
2. Test includes the header code and tests it.
3. Test continues running its test-specific code.
How could I achieve this? Thank you in advance.
HtmlListItem liItem = Find.ByExpression<HtmlListItem>(
"id=56e5c928-4413-4a36-8676-72bea0c4e51d"
);
liItem.Find.ByExpression<HtmlImage>("class=menu-button").MouseClick();
I'm trying to find a parent Div by the <h2> TextContent = "Cleaning and Inspection (LLT)" by iterating throw aReadOnlyCollection of HtmlDivs and get a NullException.
public
ReadOnlyCollection<HtmlDiv> InfoObjectList
{
get
{
return
GetDataTab().Find.AllByExpression<HtmlDiv>(
"class=infoObjPrint"
);
}
}
public
virtual
HtmlDiv GetInfoObject(
string
infoObjectText)
{
foreach
(var item
in
InfoObjectList)
{
var text = item.Find.ByContent(
"h2"
).TextContent.Trim();
if
(text.Equals(infoObjectText))
{
return
item;
}
}
return
null
;
}
<
div
class
=
"infoObjPrint"
id
=
"S05842977912008092400000"
>
<
a
data-name
=
"S05842977912008092400000"
></
a
>
<
h2
><
span
class
=
"searchTermHighlight"
>Cylinder Head</
span
> Cleaning and Inspection (LLT)</
h2
>
<
div
class
=
"tipsContainer"
data-id
=
"S05842977912008092400000"
></
div
>
<
p
>
<
span
class
=
"clsListTitle"
>Tools Required</
span
>
</
p
>
<
ul
class
=
"clsBULLET"
>
<
li
>
<
span
class
=
"clsEmphBOLD"
>EN 46122 </
span
>
Hi I am evaluating telerik Testing Framework to Automate my test. The page "http://docs.telerik.com/teststudio/testing-framework/write-tests-in-code/silverlight-wpf-automation-wtc/locating-elements" shows that one can use "Automation Id", "ByText" etc except ByName (Which doesn't work, it doesn't find the textbox).
Also i used "app.FindName<TextBox>("Password").Text = "xyz";" But this throws an error saying it cannot find the element.
Please let me know what I am missing.
I am trying to get the AutomationProperties.ItemStatus using the Telerik Test framework and it does not seem to exist anywhere. Is the only way around it to do the following? Surely there is a way directly from Telerik framework?
Get the handle from the Telerik framework and then use the System.Windows.Automation framework as follows...
var wpfHandle = customTelerikFrameworkElement.wpfWindow.Window.Handle
System.Windows.Automation.AutomationElement.FromHandle(this.wpfWindow.Window.Handle);
var root = System.Windows.AutomationAutomationElement.RootElement;
var image = root.FindFirst(TreeScope.Descendants, new System.Windows.Automation.PropertyCondition(System.Windows.Automation.AutomationElement.AutomationIdProperty, indicatorImage.AutomationId));
var props = image.GetSupportedProperties();
var prop = props.FirstOrDefault(p => p.ProgrammaticName == "AutomationElementIdentifiers.ItemStatusProperty");
var statusPropertyValue = image.GetCurrentPropertyValue(prop);
I believe there is a bug with the InputValue property. I have two kendo numeric text boxes, each with different values. However, when attempting to get the values they always return the value of the first box. I know the right ones are being selected because I can add attributes and get the correct attributes back. Just the InputValues return incocrrectly
var elements = myManager.ActiveBrowser.Find.AllByXPath(
"//div[@id='glazeWindow']//*[contains(@class,'k-widget')]"
);
KendoInput txtOne = elements[0].As<KendoInput>();
var q = txtOne.Attributes;
KendoInput txtTwo = elements[3].As<KendoInput>();
var z = txtTwo.Attributes;
Debug.WriteLine(txtOne.InputValue);<br>Debug.WriteLine(txtTwo.InputValue);
<
tbody
class
=
"ng-scope"
ng-repeat
=
"item in editBuildingFloorArea.placeSizes"
><
br
><
br
><
tr
><
br
><
br
><
td
><
br
><
br
><
span
class
=
"k-widget k-numerictextbox"
style
=
""
><
br
><
br
><
span
class
=
"k-numeric-wrap k-state-default k-expand-padding"
><
br
></
span
><
br
></
td
><
br
><
br
><
td
><
br
><
br
><
td
><
br
><
br
><
td
class
=
"center"
><
br
></
tr
><
br
></
tbody
><
br
><
br
><
tbody
class
=
"ng-scope"
ng-repeat
=
"item in editBuildingFloorArea.placeSizes"
><
br
><
br
><
tr
><
br
><
br
><
td
><
br
><
br
><
span
class
=
"k-widget k-numerictextbox"
style
=
""
><
br
><
br
><
span
class
=
"k-numeric-wrap k-state-default k-expand-padding"
><
br
></
span
><
br
></
td
><
br
><
br
><
td
><
br
><
br
><
td
>
Hi All,
I have seen about 5 or 6 threads on this issue with no real solution or explanation given. I am in Visual Studio 2013 with Telerik Testing Framework. I am using examples provided by your support staff. I have added ArtOfTest.WebAii and Telerik.TestingFramework.Controls.KendoUI references to my solution. Then I have added the following namespaces to my test file (most of which I know are not necessary):
using
ArtOfTest.WebAii;
using
ArtOfTest.WebAii.Controls;
using
ArtOfTest.WebAii.Controls.HtmlControls;
using
ArtOfTest.WebAii.Controls.HtmlControls.HtmlAsserts;
using
ArtOfTest.WebAii.Core;
using
ArtOfTest.WebAii.ObjectModel;
using
NUnit.Framework;
using
Telerik.TestingFramework.Controls.KendoUI;
namespace
VNextTelerik
{
[TestFixture]
public
class
Class1
{
public
Manager myManager;
[SetUp]
public
void
TestFixtureSetUp()
{
// Initialize the settings
Settings mySettings =
new
Settings();
// Set the default browser
mySettings.Web.DefaultBrowser = BrowserType.FireFox;
// Create the manager object
myManager =
new
Manager(mySettings);
// Start the manager
myManager.Start();
}
[Test]
public
void
Kendo()
{
myManager.LaunchNewBrowser();
myManager.ActiveBrowser.NavigateTo(
"http://demos.kendoui.com/web/numerictextbox/events.html"
);
System.Threading.Thread.Sleep(5000);
myManager.ActiveBrowser.RefreshDomTree();
KendoInput textBox = myManager.ActiveBrowser.Find.ByExpression<KendoInput>(
"class=k-widget k-numerictextbox"
);
textBox.TypeText(
"50"
);
}
[TearDown]
public
void
TearDown()
{
// Shut-down the manager and do all clean-up
myManager.Dispose();
}
}
Every time it runs (KendoInput textBox = myManager.ActiveBrowser.Find.ByExpression<KendoInput>("class=k-widget k-numerictextbox");) this returns null. I have tried many many things changing DomRefreshTree, waiting for element, longer thread.sleep (terrible solution). Ive tried to intialize the object as so(KendoInput textBox = new KendoInput).What could be the issue? Ive ran it at least 40 times and only one time did it actually find the object. Ive attached the solution. In all the other threads with this problem your support staff runs peoples project and says it works. I am looking for a reason this may be happening and a possible solution.
thanks