Hi,
When record and execute in IE, the scripts is working fine but using FF/Chrome, it is not working
eg. Let say I write a script below
1) Navigate to URL
2) login
3) navigate first hyperlink
4) navigate second hyperlink
5) Edit text
IE can execute all steps with passed result. If I run Chrome, it will stuck at step 4 even though Telerik test studio already navigate the second hyperlink. Same goes to FF that stuck at different steps. Sometimes when I abort the execution for Chrome/FF, it cannot navigate to step 1 URL and automate at all. I have to close the telerik test studio and execute again. Any idea why? configuration problem again ? I can't share my script as I am using my company website to automate. Let me know if you need additional info.
7 Answers, 1 is accepted
Thank you for taking the time to evaluate Test Studio for your test automation needs. Please let the test fail then go to Step Failure Details, find and click Export then attach the generated .zip file. It contains valuable information we need to diagnose this type of failure.
Regards,
Cody
Telerik
Hi Cody,
As attached per requested, I am using chrome to run it .. the error hit when trying to enter the document but actually it is already entered. IE no problem and passed.
Thank you for the additional information. I now see that is failing inside coded step number 4.
'21-Dec-15 9:22:55 AM' - 'Fail' : 4. [EditReview_VerifyCommentOnly_CodedStep] : Enter first review document
------------------------------------------------------------
Failure Information:
~~~~~~~~~~~~~~~
Exception thrown executing coded step: '[EditReview_VerifyCommentOnly_CodedStep] : Enter first review document'.
InnerException:
System.TimeoutException: 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.Core.Browser.WaitUntilReady()
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.Click(Element targetElement)
at ArtOfTest.WebAii.Controls.HtmlControls.HtmlControl.Click()
at PleaseReview6_0.EditReview_VerifyCommentOnly.EditReview_VerifyCommentOnly_CodedStep() in c:\SVNSource\QA\Automation\Telerik\PleaseReview6.0\EditReview_VerifyCommentOnly.tstest.cs:line 140
This particular error is trying to tell you that Test Studio timed out waiting for the browser to return to a ready state after executing some action command such as clicking on a link or a button. We can overcome this problem but before I can help you fix it I need to see the whole code for this step. Please show me the code for step number 4. Once I see the code then I will be able to advise you how to change it so that we don't run into this error.
I agree with you, we can see the full document is loaded in the browser, as shown in the attached screenshot, which came from your step failure details. What I am concerned about is that it appears this data is being loaded using a chrome extension which I can see in the browser's DOM:
<
script
src
=
"chrome-extension://pncoonbpgmlbbjnnmaindchmjckkjcdb/contentProcessor.js"
type
=
"text/javascript"
></
script
>
Because of this, this data is going to appear as a black box to Test Studio. That means Test Studio is unable to see this data, let alone parse it or interact with it. The best we can do is solve the error you are getting so that the form will load in the browser and then we can see what we can do to move on to the next page. Unfortunately Test Studio will be unable to verify any of the contents of this particular document since it cannot see the contents of this document.
I look forward to hearing back from you soon.
Regards,
Cody
Telerik
Hi Cody,
Ok sure, below code in Step 4. I am trying to find the first Enter hyperlink in a table
HtmlAnchor a = Pages.PleaseReview.FrameMain.GvOwnerReviewsTable.Find.ByExpression<HtmlAnchor>("TextContent=Enter", "tagname=a");
Log.WriteLine("EnterReview: " + a.HRef);
a.Click();
To overcome the issue we just need to change a.Click into a mouse click. Here's the code that does that:
HtmlAnchor a = Pages.PleaseReview.FrameMain.GvOwnerReviewsTable.Find.ByExpression<HtmlAnchor>(
"TextContent=Enter"
,
"tagname=a"
);
Log.WriteLine(
"EnterReview: "
+ a.HRef);
//a.Click();
a.MouseClick();
The functional difference between these 2 is that .Click has a built-in wait until ready. Versus a mouse click does not wait until the browser is ready. The code immediately moves on to the next step as soon as the mouse click is finished without waiting for the browser to be done.
Regards,
Cody
Telerik
Hi Cody,
I changed the code and it can execute smoothly in IE and Chrome now.
As for FF,sometimes it can execute and cannot. I will post under http://www.telerik.com/forums/firefox-recorder-on-and-off-working-only
This can be case closed for now. Thanks for your assistance!
I'm very glad to hear the solution works well for IE and Chrome. I don't know why it would be intermittent for Firefox, but we can pursue this issue in your other post.
Also you're welcome for the assistance. I'm glad I could help.
Regards,
Cody
Telerik