This is a migrated thread and some comments may be shown as answers.
Tests Failing when running under local system
1 Answer 53 Views
This is a migrated thread and some comments may be shown as answers.
Sam
Top achievements
Rank 1
Sam asked on 08 Mar 2012, 10:35 PM
I'm running tests using the testing framework under with Cruise Control.NET, Specflow, and Nunit. I build the project under CCNet and run it under IIS express. Then I run the specflow tests which are using the Telerik framework. CCNet is being run as a service, so it's running in the background, and yes, I've set it up so that it's interactive (when I run 'sc interrogate ccservice', It returns 110). 

If I run Nunit under my account against the website running in the background all is well, and all the tests pass. But if I have CCNet run the nunit tests, it fails. All of the tests return the following

System.NullReferenceException : Object reference not set to an instance of an object. TearDown : System.NullReferenceException : Object reference not set to an instance of an object.
at ArtOfTest.WebAii.Core.Manager.SetupDialogMonitoring()
at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)
at ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle)
at TechTalk.SpecFlow.Bindings.MethodBinding.InvokeAction(Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
at TechTalk.SpecFlow.TestRunner.FireEvents(BindingEvent bindingEvent, IEnumerable`1 tags)
at MyWebGrocer.Uma.Integration.Stories.Recipes.OptionalRecipeDetailsFeature._2ViewRecipeDetailsForRecipeContainingCookTime2()
--TearDown
at MyWebGrocer.Uma.Integration.Stories.TelerikTest.TelStepDefinitions.MyTestCleanUp()
at TechTalk.SpecFlow.Bindings.MethodBinding.InvokeAction(Object[] arguments, ITestTracer testTracer, TimeSpan& duration)
at TechTalk.SpecFlow.TestRunner.FireEvents(BindingEvent bindingEvent, IEnumerable`1 tags)
at TechTalk.SpecFlow.TestRunner.OnScenarioEnd()

Any ideas as to why? I Get a null reference exception when ever it tries to launch a new browser. Why isn't it able to do so?

1 Answer, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 08 Mar 2012, 10:54 PM
Hello Sam,

I am sorry but this is expected behavior when you run CC.NET as a service. It must be launched from the command line so that it runs using real user credentials instead of the LocalSystem credentails. The LocalSystem credentials are not allowed to launch desktop applications such as IE. We have documented this in step 4.5 here.

Regards,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Asked by
Sam
Top achievements
Rank 1
Answers by
Cody
Telerik team
Share this question
or