Running UI Tests from Bamboo


We are having some problems running .Net unit tests from Bamboo. It seems that the results when we run them from bamboo aren't the same as when we run them manually using VS2010 or mstest.

Our theory is that the UI itself isn't being loaded, and we have tested it by adding the following test to our build:

        public void TestBamboo()
            var window = new Window();
            window.Loaded += new RoutedEventHandler(window_Loaded);


        void window_Loaded(object sender, RoutedEventArgs e)
            throw new NotImplementedException();

So the test should fail when the window loads, and it does so from my machine. However, this test succeeds from bamboo.

We have tried running bamboo from the console instead of the service, but to no avail.

How can we run these tests in interactive mode even when we aren't logged into the machine running bamboo?

The build server is a Windows Server 2008 R2, and bamboo is running locally.

5 answers

1 accepted

0 votes
Accepted answer

Ran in to this same issue, and it is related to Session 0 Isolation, a security feature of Vista and 7.

I was able to install Bamboo agent as a service, yet kick off GUI tests by using the following advice:

0 votes
Joe Clark Atlassian Team Mar 20, 2012

I assume your Window is a WinForms app?

You won't be able to run the Bamboo agent as a Windows service - it will need to run as a console app from within a logged-on user session.

How are you running your .NET build tasks? Are you using a shell script to start the test process, or are you using the built-in tasks?

Yes. How are you running the Bamboo agent and what credentials is it running with? A system account will NOT have access to the console. Your local tests succeed because you're already logged in to the Desktop with a user (yours) that has access to it.

Setup a local account for the bamboo agent, give it access to the Desktop and run your agent with that or give the system account access to the console.

Hi, thanks for your answers.

To answer your questions:

- This is a WPF app, not WinForms.

- We are using the built-in MSTest Runner task, but have also tried an NAnt script and the MSTest Result Parser.

- We are running the Bamboo console as Administrator, which I would assume would have access to everything.

Maybe we are doing something wrong, but I can't see what that is.

We are logging in to remote desktop, running the console from the shortcut in the start menu (with elevated permissions) and starting the build from the web interface, remote desktop still logged in.

We will try again, but please point out any flaws in our execution if you can find them.

Hi Scotty, thanks for the link. For reason beyond my comprehension, we are now able to run these aforementioned tests without changing the session. But I will be sure to keep your link in case it crops up again.



Hello Troels,

I am also facing the same issue. GUI is not getting invoked when running test using Mstest through Bamboo build.

Could you please help on this issue.

Many Thanks,


Suggest an answer

Log in or Sign up to answer
Community showcase
Posted Dec 10, 2018 in Confluence

Organizing your space just got easier - Page Tree Drag & Drop is here

Hi Community! I’m Elaine, Confluence Product Manager. You may have read my earlier post about page tree in space navigation sidebar. I'm excited to share another improvement that helps you organize ...

215 views 6 8
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you