Running webdriver via Teamcity

Hi,

I have created an automated framework that uses Webdriver to run over 400 checks.  This builds and runs OK within visual studio 2012, but when they're run via TeamCity its complaining about null pointer exceptions.  This is a suprise to me as I get no such errors if I run my checks in visual studio - They all pass, as expected.

I am vaguely aware that with Team City, it works on the principle of a headless browser but it seems that this may be the issue that is making my checks fail.

I've read previously that this is possible via a console, but as we have about 10 different projects already in Team City I feel this is not a viable option - particularly when the automation checks needs to be started automatically upon each successful build.

Is there any way I can get to run my checks within Team City?  Are there any configuration settings that I need to be aware of?

Many thanks.

John

5 comments
Comment actions Permalink

HI John,

Have you tried to run this build on the same machine as the TeamCity agent and under the same user that the agent is running? Please follow the guideline described in this section.

0
Comment actions Permalink

Hi Alina,

Many thanks for the reply.  I've read your post and I forgotten to mention that I'm using MSTest as a test runner.  If I open up a Visual Studio command prompt and run my tests in the console using mstest /testcontainer:TestCases.dll, all my tests pass.  If run through TeamCity via an agent, all my tests fail! ?:|

I've compared the files generated in TC with the files when run manually (via VS) and they're identical so it doesn't look to be an artifacts issue.

I'm *really* stumped as to why all my MSTest cases fail in Teamcity and but pass via the visual studio console.

Regards

John

0
Comment actions Permalink

John,

MSTest and Visual Studio do not work the same way. In TeamCity the MSTest.exe runner is used. Please try to run tests locally via command line using MSTest.exe, not in Visual Studio? If you are able to run them via command line, then they should run successfully in TeamCity.

0
Comment actions Permalink

Many thanks for the reply Alina.  Are you suggesting that MS Test being run in TeamCity and Visual Studio are different?  When run in both environments, the versions are identical.

Furthermore, the outcomes between the two are very different: 90% of my checks pass in Visual studio command line, whereas they all fail in Team City.

Regards

John

0

Please sign in to leave a comment.