This is a migrated thread and some comments may be shown as answers.

Unable to run multiple tests in a row using Safari

4 Answers 98 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Chris
Top achievements
Rank 1
Chris asked on 08 Mar 2011, 12:29 AM
Hello,

We are currently running into a issue using safari where we are unable to run more than a few test cases in one run.  This even happens with the Sample code that ships with WebAii. 

Here is what I did in the sample code.
  1. In app.confg change configuration\WebAii.Settings\defaultBrowser="Safari"
  2. Build
  3. Open Test List Editor
  4. Run the first 5 test cases

Here is the output from the run:
Passed QuickStarts_VSTS_CS.UsingAspNetDevSrv.UseAspNetDevServer 
 
Failed QuickStarts_VSTS_CS.AjaxSupport.WaitingForMultiplePageChanges Initialization method QuickStarts_VSTS_CS.AjaxSupport.MyTestInitialize threw exception. System.TimeoutException: System.TimeoutException: Wait for condition has timed out. 

Failed QuickStarts_VSTS_CS.TestRegions.AccessingTestRegions Assert.IsTrue failed.  

Failed QuickStarts_VSTS_CS.TestRegions.AccessingElementsUsingTestRegions Test method
QuickStarts_VSTS_CS.TestRegions.AccessingElementsUsingTestRegions threw exception:
... 

Failed QuickStarts_VSTS_CS.TestRegions.UsingFindParamAttributeWithTestRegions Test method QuickStarts_VSTS_CS.TestRegions.UsingFindParamAttributeWithTestRegions threw exception:
... 

Error QuickStarts_VSTS_CS.AjaxSupport.WaitingForSinglePageChange The agent process was stopped while the test was running. 


The first one always passes for me. After that however is seems the environment gets in a bad state and nothing will pass from that point onwards.

Is this a known issue with Safari? 
Does anyone know of any workarounds?

We are currently blocked by this and I need to find a workaround as soon as possible.

Thanks,
Chris

4 Answers, 1 is accepted

Sort by
0
Chris
Top achievements
Rank 1
answered on 08 Mar 2011, 03:10 AM
I also ran some further testing to see what would and would not work for 4 of the supported browers listed on the main Telerik site.

Here are the 4 browsers I used
  1. Internet Explorer 9.0.8080.16413
  2. FireFox 3.6.13
  3. Safari 5.0.3
  4. Chrome 9.0.597.107

I took 5 test cases from QuickStarts_VSTS_CS project that ships with the Telerik binaries.  None of the test cases I picked specify a specific browser and pull the value from the app.config.

  1. QuickStarts_VSTS_CS.WebAii2Samples.JavascriptReturnsObject
  2. QuickStarts_VSTS_CS.WebAii2Samples.JavascriptEventNotifications
  3. QuickStarts_VSTS_CS.WebAii2Samples.ChainedFindExpressions
  4. QuickStarts_VSTS_CS.WebAii2Samples.MouseEvents
  5. QuickStarts_VSTS_CS.WebAii2Samples.JavascriptReturnsJson

Here are the results I recieved:
Internet Explorer: 5/5 PASSED
FireFox:                5/5 PASSED
Safari:                  0/5 PASSED
Chrome:                0/5 PASSED

When I debug into the failures the following call to the active browser never seems able to suceed.

ActiveBrowser.NavigateTo(Path.Combine(TestContext.TestDeploymentDir, "WebAii2Pages/JavascriptFunctions.html"));

This leaves me with the following questions.

  • Is a browser i am currently running against not supported?
  • If all of these browsers are supported does anyone have any ideas I can try to make these test cases pass for all browsers?

Thanks,
Chris

0
Chris
Top achievements
Rank 1
answered on 08 Mar 2011, 10:41 PM
Any ideas at what could be wrong?  We are currently blocked by this.

Thanks,
Chris
0
Kashyap
Top achievements
Rank 1
answered on 10 Mar 2011, 07:35 PM
Chris,

We also had the same issue its issue with WebAii library that thinks it killed the Safari instance before spawning a new one but there is some delay before the process is actually killed. Long story short put Thread.Sleep() delays between tests of order of 2 - 5 seconds to make it work reliably. I have seen it show the same issue for Firefox too.

Thanks,
Kashy
0
Chris
Top achievements
Rank 1
answered on 10 Mar 2011, 10:56 PM
That is the best answer I have been given so far.  I will give it a try and let you know.

Thanks,
Chris
Tags
General Discussions
Asked by
Chris
Top achievements
Rank 1
Answers by
Chris
Top achievements
Rank 1
Kashyap
Top achievements
Rank 1
Share this question
or