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

NullReferenceException From TFS Build

6 Answers 119 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Thorri
Top achievements
Rank 1
Thorri asked on 21 Jun 2011, 01:55 PM
Hi All.
We are trying to run Web tests from our TFS weekly build.

But all tests fail with the following:

System.NullReferenceException: Object reference not set to an instance of an object.

ArtOfTest.WebAii.Core.Manager.SetupDialogMonitoring()
ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)


I have registred TFS build interactive port from the following ( http://msdn.microsoft.com/en-us/library/bb399142.aspx ), but that does not seem to have any changes.

any suggestions on what I have been missing ?

best regards 
thorri.


 

6 Answers, 1 is accepted

Sort by
0
Cody
Telerik team
answered on 27 Jun 2011, 10:00 PM
Hi Thorri,

I am sorry you are running into this problem. Am I correct in assuming the same tests run just fine on your local development machine? What if you manually execute the tests from the command line on the TFS test machine? Here is documentation on how to run tests via MSTest from the command line. Let us know the results of this diagnostic step and we'll go from there.

Greetings,
Cody
the Telerik team
Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

Have you looked at the new Online User Guide for Telerik Test Studio?
0
Eyjolfur
Top achievements
Rank 1
answered on 04 Jul 2011, 12:41 PM
The tests run fine on local machine and the server when logged in and running the tests with mstest.exe.  Using testlist or testcontainer does not matter, both work fine.
"Test method MyTest threw exception: System.NullReferenceException: Object reference not set to an instance of an object."

My fealing is that the problem is server side as the Team Foundation Build service is not "Local System account" and "Allow service to interact with desktop" not checked.

Is it possible to let the tests run this way?

cheers,
Eyjolfur
0
Cody
Telerik team
answered on 05 Jul 2011, 07:34 PM
Hi Eyjolfur,

You state "Build service is not "Local System account"... which account is it set to use then?

Regarding " "Allow service to interact with desktop" not checked" this depends on the test. A pure HTML/DOM test (i.e. one that does not move the mouse or use simulated keystrokes) can run this way. Many HTML tests can work this way. However Silverlight and WPF tests cannot. Most actions in that world must use the mouse and keyboard. The "Allow service to interact with desktop" is what allows (or prevents) a process from using the mouse and/or keyboard.

Regards,
Cody
the Telerik team
Register today for a live 'What's New in Test Studio R1 2011 SP2' event on Tuesday, July 19 at 2pm EST!

Have you looked at the new Online User Guide for Telerik Test Studio?
0
Shashi
Top achievements
Rank 1
answered on 09 Jul 2011, 09:30 PM

Hi Eyjolfur,

 

Make sure that ALL the following conditions are met for the test server (the machine on which the TFS test agent is running which will also be the machine on which the browser will be opened):

a) Test agent is running as an interactive process - not as a service (you will need to specify a user and password for the agent to log on)
b) There is an active login session on the test server for the user mentioned above
c) The test server is not locked, on standby or hibernated when the test runs
d) Browser is not minimized when the test runs.

If all the above are true, log on to the test server yourself (using the user credentials that the test agent is registered under) and see if you can figure out how far it is getting (does the browser come up?  does it connect to the site? etc) and what the problem might be (any exception or other dialogs)?

Hope that helps,
Shashi

0
Mateusz
Top achievements
Rank 1
answered on 07 Mar 2012, 08:19 PM
Hi,

I have the similar problem problem but we are using Hudson instead of TFS.
The tests run fine on local machine and the server when logged in and running the tests with mstest.exe.  Using testlist or testcontainer does not matter, both work fine.
When we run our tests from Hudson as a batch task all of our tests failed with the following:
System.NullReferenceException: Object reference not set to an instance of an object.

ArtOfTest.WebAii.Core.Manager.SetupDialogMonitoring()
ArtOfTest.WebAii.Core.Manager.LaunchNewBrowser(BrowserType browserToLaunch, Boolean waitForBrowserToConnect, ProcessWindowStyle windowStyle, String arguments)

I also read also http://www.telerik.com/automated-testing-tools/community/forums/test-studio-express/automation-framework/issues-with-telerik-automated-testing-in-hudson-ci.aspx

Could you sumarize once again how hudson should be configured to run run properly tests?


Thanks in advance!
Mateusz
0
Cody
Telerik team
answered on 07 Mar 2012, 11:08 PM
Hi Mateusz,

You are probably trying to run your tests on a locked machine. This is known to not work for UI automation. Here's an article describing one possible solution to this problem.

All the best,
Cody
the Telerik team
Quickly become an expert in Test Studio, check out our new training sessions!
Test Studio Trainings
Tags
General Discussions
Asked by
Thorri
Top achievements
Rank 1
Answers by
Cody
Telerik team
Eyjolfur
Top achievements
Rank 1
Shashi
Top achievements
Rank 1
Mateusz
Top achievements
Rank 1
Share this question
or