Telerik Forums
Testing Framework Forum
1 answer
100 views
Hi All,

We have a problem where we are trying to focus on a HTML textarea but the code keeps writing it in the IE address bar. Any suggestions will be appreciate. Thanks in advance!
Cody
Telerik team
 answered on 25 Feb 2013
2 answers
300 views
Hello,

we've tried using Telerik WebAii framework on publicly accessed site thomsons.com and encountered multiple issues. Some of them are described below:

A lot of elements can't be found in IE by xpath (and are successfully found in Chrome):
[Test]
        public void IEIssue()
        {
            Manager.Current.ActiveBrowser.RefreshDomTree();
 
            string xpath = "//a[child::span[contains(text(), 'Enrolment Calculator')]]";
 
            var htmlFindExpression = new HtmlFindExpression(string.Format("XPath={0}", xpath));
            Manager.Current.ActiveBrowser.WaitForElement(htmlFindExpression, 10000, false);
 
            Element anchor = Manager.Current.ActiveBrowser.Find.ByXPath(xpath); // not found in IE
            anchor.As<HtmlAnchor>().Click();
        }

The following exception is thrown on "WaitForElement" line:
Exception thrown during the wait for a condition. Error: Unexpected error while waiting on condition. Error: System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation. ---> System.Exception: Refresh() failed due to an unexpected exception. ---> System.ArgumentException: The empty string '' is not a valid name.
Parameter name: docTypeName
   at System.Xml.DtdParser.InitializeFreeFloatingDtd(String baseUri, String docTypeName, String publicId, String systemId, String internalSubset, IDtdParserAdapter adapter)
   at System.Xml.DtdParser.System.Xml.IDtdParser.ParseFreeFloatingDtd(String baseUri, String docTypeName, String publicId, String systemId, String internalSubset, IDtdParserAdapter adapter)
   at System.Xml.XmlLoader.ParseDocumentType(XmlDocumentType dtNode, Boolean bUseResolver, XmlResolver resolver)
   at System.Xml.XmlLoader.ParseDocumentType(XmlDocumentType dtNode)
   at System.Xml.XmlDocumentType..ctor(String name, String publicId, String systemId, String internalSubset, XmlDocument doc)
   at System.Xml.XmlDocument.CreateDocumentType(String name, String publicId, String systemId, String internalSubset)
   at System.Xml.XmlDocument.CreateNode(XmlNodeType type, String prefix, String name, String namespaceURI)
   at System.Xml.XmlDocument.CreateNode(XmlNodeType type, String name, String namespaceURI)
   at ArtOfTest.WebAii.ObjectModel.Element.BuildXml(XmlDocument doc, XmlNode parent, Element element, Boolean withAbsoluteIndex, Boolean allChildNodes, Boolean ignoreTestRegionTags)
   at ArtOfTest.WebAii.ObjectModel.Element.BuildXml(XmlDocument doc, XmlNode parent, Element element, Boolean withAbsoluteIndex, Boolean allChildNodes, Boolean ignoreTestRegionTags)
   at ArtOfTest.WebAii.ObjectModel.Element.BuildXml(XmlDocument doc, XmlNode parent, Element element, Boolean withAbsoluteIndex, Boolean allChildNodes, Boolean ignoreTestRegionTags)
   at ArtOfTest.WebAii.ObjectModel.Element.BuildXml(XmlDocument doc, XmlNode parent, Element element, Boolean withAbsoluteIndex, Boolean allChildNodes, Boolean ignoreTestRegionTags)
   at ArtOfTest.WebAii.ObjectModel.Element.BuildXml(XmlDocument doc, XmlNode parent, Element element, Boolean withAbsoluteIndex, Boolean allChildNodes, Boolean ignoreTestRegionTags)
   at ArtOfTest.WebAii.ObjectModel.Element.BuildXml(XmlDocument doc, XmlNode parent, Element element, Boolean withAbsoluteIndex, Boolean allChildNodes, Boolean ignoreTestRegionTags)
   at ArtOfTest.WebAii.ObjectModel.Element.BuildXml(XmlDocument doc, XmlNode parent, Element element, Boolean withAbsoluteIndex, Boolean allChildNodes, Boolean ignoreTestRegionTags)
   at ArtOfTest.WebAii.ObjectModel.Element.BuildXml(XmlDocument doc, XmlNode parent, Element element, Boolean withAbsoluteIndex, Boolean allChildNodes, Boolean ignoreTestRegionTags)
   at ArtOfTest.WebAii.ObjectModel.Element.GetXmlDocument(Element root, Boolean withAbsoluteIndex, Boolean allChildNodes, Boolean ignoreTestRegionTags)
   at ArtOfTest.WebAii.ObjectModel.Element.ToXml(Boolean allChildNodes, Boolean ignoreTestRegionTags, Boolean emitAbsIndex)
   at ArtOfTest.WebAii.ObjectModel.Element.ToXml(Boolean allChildNodes, Boolean ignoreTestRegionTags)
   at ArtOfTest.WebAii.Core.HtmlTreeCrawler.FindUsingHierarchicalClause(Element startNode, HtmlFindClause clause)
   at ArtOfTest.WebAii.Core.HtmlTreeCrawler.FindUsingHierarchicalClause(Element startNode, HtmlFindClause clause, Boolean includeRoot)
   at ArtOfTest.Common.TreeCrawler`3.Find(T startNode, IList`1 clauses, V expression, Boolean includeRoot, Boolean ignoreContraints)
   at ArtOfTest.Common.TreeCrawler`3.ByExpression(T startNode, V expression, Boolean includeRoot)
   at ArtOfTest.WebAii.Core.Find.ByExpression(HtmlFindExpression expression, Boolean includeRoot)
   at ArtOfTest.WebAii.Core.Find.ByExpression(HtmlFindExpression expression)
   at ArtOfTest.WebAii.ObjectModel.Element.Refresh()
   --- End of inner exception stack trace ---
   at ArtOfTest.WebAii.ObjectModel.Element.Refresh()
   at ArtOfTest.WebAii.ObjectModel.Element.Refresh(Boolean forceDomTreeRefresh)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle._InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, SignatureStruct& sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.RuntimeMethodHandle.InvokeMethodFast(IRuntimeMethodInfo method, Object target, Object[] arguments, Signature sig, MethodAttributes methodAttributes, RuntimeType typeOwner)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture, Boolean skipVisibilityChecks)
   at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.Reflection.MethodBase.Invoke(Object obj, Object[] parameters)
   at ArtOfTest.Common.WaitAsync.CallRefreshIfNeeded[T](T target)
   at ArtOfTest.Common.WaitAsync._worker_DoWork[T,V](Object waitParam)

There is a link on the side that opens a page in new window. In framework reference and different threads (including this forum) it is said to use WaitForNewBrowserConnect, but it is not working:

[Test]
        public void NewPageIssue()
        {
            Manager.Current.ActiveBrowser.NavigateTo("http://www.thomsons.com/auto-enrolment-staging-dates-and-cost-calculator");
 
            Manager.Current.ActiveBrowser.Find.ByXPath("//a[text()='Auto Enrolment Guide']").As<HtmlAnchor>().Click(); //in IE not found, exception
 
            Manager.Current.WaitForNewBrowserConnect("thomsons.com/aeguide", true, 10000); // in Chrome "Exception occured waiting for the new browser to connect." exception
        }

There also a strange error when trying to invoke "OnMouseOver" event in Chrome:
[Test]
        public void InvokeEventIssue()
        {
            string xpath = "//a[text()='Find us']";
 
            Manager.Current.ActiveBrowser.RefreshDomTree();
 
            Element anchor = Manager.Current.ActiveBrowser.Find.ByXPath(xpath);
 
            anchor.As<HtmlAnchor>().InvokeEvent(ScriptEventType.OnMouseOver); // "ExecuteCommand failed" exception in Chrome
        }

InvokeEvent from above throws the following:
ArtOfTest.WebAii.Exceptions.ExecuteCommandException was unhandled by user code
  Message=ExecuteCommand failed!
InError set by the client. Client Error:
Object [object Object] has no method 'parse'
BrowserCommand (Type:'Action',Info:'NotSet',Action:'InvokeEvent',Target:'ElementId (tagName: 'a',occurrenceIndex: '47')',Data:'onmouseover--@@--null',ClientId:'494163fc-0107-4773-a725-6787f71dd4ca',HasFrames:'False',FramesInfo:'',TargetFrameIndex:'-1',InError:'True',Response:'Object [object Object] has no method 'parse'')
InnerException: none.
 
  Source=ArtOfTest.WebAii
  StackTrace:
       at ArtOfTest.WebAii.Core.Browser.ExecuteCommandInternal(BrowserCommand request)
       at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request, Boolean performDomRefresh, Boolean waitUntilReady)
       at ArtOfTest.WebAii.Core.Browser.ExecuteCommand(BrowserCommand request)
       at ArtOfTest.WebAii.Core.Actions.InvokeEvent(Element targetElement, ScriptEventType eventType)
       at ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl.InvokeEvent(ScriptEventType eventType)
       at testProject.Tests.InvokeEventIssue() in C:\Users\userName\Desktop\testProject\testProject\tests\tests.cs:line 155
  InnerException:

Chrome version: 24.0.1312.57 m
IE version: 8
WebAii version: 2012.2.1204

So, as you can understand, it's very frustrating experience to get exceptions almost on each step, on different browsers on a real(production) site.

Can you please assist us with the issues from above?
Thank you,
Andrei.
Andrei
Top achievements
Rank 1
 answered on 25 Feb 2013
5 answers
190 views
I have just installed 01120Telerik.WebUI.TestStudio.QA.2010.3.1502_Trial from telerik, I have recorded on IE and playback on IE and FF are OK.
But when I playback on Safari 5.0.3 and Chrome 10, only open browser with URL (step 1) and does not execute other steps
Could you please tell me this WebUI version supports which version of two browsers above on Silverlight?
Mario
Telerik team
 answered on 19 Feb 2013
3 answers
100 views
Hi,

When I navigate to  ActiveBrowser.NavigateTo("http://www.gmail.com");
and try to find the styles applied on sign in button
HtmlInputSubmit btn = Find.ById <HtmlInputSubmit>("signIn");
HtmlStyle btnStyles = btn.GetComputedStyle("font-size");

it  does not return anything.

I have  2 questions
1. Is this the right way to find out the  styles applied on a control
2.If not, can you please tell me the right way to find out a style property of a control.

Thanks,
Amey.
Stoich
Telerik team
 answered on 14 Feb 2013
1 answer
76 views
Hi, 

I have a website that consists of a big image showing items that are on promotion. Clicking on an area of this image will show a div that shows details of that item. What is the code to click on a map-area on an image? I will appreciate any help.
The following is how the map and areas are mentioned and I would like the code to click on the first area.

<map id="pagemap_3636171" name="pagemap_3636171">
<area href="javascript:void(0)" coords="33,674,313,987" shape="rectangle" data-mapareaid="50053070" data-listingid="-2056081385" data-pageid="3636171" data-link="" data-tracking-method="click" data-tracking-origin="browse ad" class="action-tracking-nav"
data-maphilight="{"fade":false, "fadeDuration":999999}">

<area href="javascript:void(0)" coords="586,1734,890,1993" shape="rectangle" data-mapareaid="50053071" data-listingid="-2056082548" data-pageid="3636171" data-link="" data-tracking-method="click" data-tracking-origin="browse ad" class="action-tracking-nav" data-maphilight="{"fade":false, "fadeDuration":999999}">
</map>

Thanks
R
Rad
Top achievements
Rank 1
 answered on 13 Feb 2013
5 answers
688 views
Hello Telerik Team
I'm automating WPF application with Telerik Testing Framework (2012_2_1204). Great framework!.
Shown in the attachment is DockPanel with 3 buttons inside. Buttons are shown on application based on business logic. Currently only Edit is shown. Other two buttons are hidden with Visibility=Collapsed. I want to verify that specific button is not shown on application window.
Having sample code structure:
Application:
namespace Test
{
    public class AppName
    {
        public ArtOfTest.WebAii.Wpf.WpfApplication ApplicationWebAii { get; private set; }
        public AppName(ArtOfTest.WebAii.Wpf.WpfApplication webAiiApp) { ApplicationWebAii = webAiiApp; }
        public WindowName WindowName { get { return new WindowName(ApplicationWebAii.WaitForWindow("WindowName").Find); } }
    }
}

Window class containing buttons. Buttons are located by exact XamlPath:
using ArtOfTest.WebAii.Controls.Xaml.Wpf;
using ArtOfTest.WebAii.Silverlight;
using ArtOfTest.WebAii.TestTemplates;

namespace Test
{
    public class WindowName : XamlElementContainer
    {
        public WindowName(VisualFind find) : base(find) { }
        public Button OK { get { return Get<Button>("XamlPath=/DockPanel[0]/Button[0]"); } }
        public Button Edit { get { return Get<Button>("XamlPath=/DockPanel[0]/Button[1]"); } }
    }
}

Trying to access button OK in my test class code: AppName.WindowName.OK gives exception:
Wait for condition has timed out:
   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.Common.WaitSync.For[T](Predicate`1 predicate, T target, Boolean invertCondition, Int32 timeout)
   at ArtOfTest.WebAii.Silverlight.VisualWait.ForVisible(Int32 timeout)
   at ArtOfTest.WebAii.TestTemplates.XamlElementContainer.Get(XamlFindExpression expr, Boolean waitOnElement, Int32 timeout)
   at ArtOfTest.WebAii.TestTemplates.XamlElementContainer.Get(XamlFindExpression expr)
   at ArtOfTest.WebAii.TestTemplates.XamlElementContainer.Get[TControl](XamlFindExpression expr)
   at ArtOfTest.WebAii.TestTemplates.XamlElementContainer.Get[TControl](String[] clauses)

This exception is thrown after ~10 seconds and is in case of Visibility=Collapsed. If button is shown then there is no exception and element is located.

I'm handling this by "try {AppName.WindowName.OK} catch (System.Exception) {} and if element is not found taking appropriate actions in catch. This work for me with the limitation that it slows down my test with 10 seconds for each hidden element invocation.

I wonder is this issue with Telerik Testing Framework or me using it incorrectly :-) Thanks for your support.
Plamen
Telerik team
 answered on 13 Feb 2013
4 answers
202 views
Hi All,

We have recently faced an issue when trying to navigate local address under Chrome using  NavigateTo() Browser object method.  The browser doesn't react to the passed URI (e.g "C:\\Users\\admin\\AppData\\Local\\Temp\\PageWeb.htm")

We use next hardware:
 OS: Win 7 x32/64
 Browser: Firefox 16.0.2
 TTF: 2012.2.1002
Chrome:23.0.1271.95 m

Thanks in advance!

Boyan Boev
Telerik team
 answered on 13 Feb 2013
3 answers
102 views
I have prepared some test cases using Telerik manager and executing it daily.
Till friday, the overall execution time is 1 minute per test case (this execution time is captured for almost two months).

But today the same test case is executed for more than 5 mins. When I debugged the TC, I can find that, Manager.Current.ActiveBrowser.Find.ByExpression is taking more time than it takes usually.  It is taking almost one minute to goto next statement eventhough the object is already visible in the document. Please let me know what is this issue.. and please let me know is there any performance issues from telerik test framework?

Regards,
Pankaj.

Mario
Telerik team
 answered on 12 Feb 2013
9 answers
155 views
Hello.

I want to customize exception messages when element not found.
For example i want to write an element path.
Is it possible?
Asta
Top achievements
Rank 1
 answered on 11 Feb 2013
3 answers
154 views
Hello,

Is there an xsd or dtd for the telerik results file .aiiresult? I would like to map the results xml file to java types.

Thanks

Plamen
Telerik team
 answered on 08 Feb 2013
Narrow your results
Selected tags
Tags
+? more
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Top users last month
Will
Top achievements
Rank 2
Iron
Motti
Top achievements
Rank 1
Iron
Hester
Top achievements
Rank 1
Iron
Bob
Top achievements
Rank 3
Iron
Iron
Veteran
Thomas
Top achievements
Rank 2
Iron
Want to show your ninja superpower to fellow developers?
Want to show your ninja superpower to fellow developers?