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):
The following exception is thrown on "WaitForElement" line:
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:
There also a strange error when trying to invoke "OnMouseOver" event in Chrome:
InvokeEvent from above throws the following:
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.
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.