Registering Workgroup Test Agent with Test Controller in Domain 22 June 2012 Donovan-Brown Work (0) Problem: I have a test controller in a domain and a test agent in a workgroup and I can’t register the agent with the controller. Solution: Create shadow accounts on the agent machine and on the controller machine that are in the Administrators Group. Shadow accounts are accounts with... [More]
How to mole System.dll 15 December 2011 Donovan-Brown Work (0) Problem: I get “no suitable method found to override” errors when I mole system.dll. Solution: Modify the System.moles file in your project and exclude everything except the types you are trying to mole. Explanation: I was trying to mole the SerialPort class in System.IO.Ports. Afte... [More]
What to do when my CUIT thows a PlaybackFailureException 09 October 2011 Donovan-Brown Work (0) Updated (Oct 11, 2011) Problem: I have a textbox that has a maximum length of five characters. I want to record a Data Driven CUIT to test that you cannot type in more than five characters. However, when I attempt to set the textbox to a six character value the CUIT throws a PlaybackFailureE... [More]
How to enable code coverage in my Team Build 03 October 2011 Donovan-Brown Work (0) Problem: I am not getting code coverage results in my build. Solution: Ensure you have a test settings file selected in your build definition. Explanation: On the process tab of your build definition expand the Automated Testing section under Basic and make sure the TestSettings File is pointin... [More]
CUIT Demo of Feature Pack 2 Coded UI Test Editor 01 October 2011 Donovan-Brown Work (0) Problem: I have a Coded UI Test that is failing on Playback. Solution: Use the Coded UI Test Editor in Feature Pack 2 to adjust the UI Map and add actions to your test. Explanation: I felt a write up would be too hard to follow so I recorded a video instead which you can watch below. In this ... [More]
I don't want Entity Framework code counted in code coverage. 29 September 2011 Donovan-Brown Work (0) Problem: The code generated by the Entity Framework is distorting my code coverage numbers. Solution: Add a Code Generation Item and add the [DebuggerNonUserCode] attribute to the generated classes. Explanation: As I described in a previous post here the [DebuggerNonUserCode] hides the code ... [More]
How to create a custom Value Provider for MVC 23 September 2011 Donovan-Brown Work (0) Problem: I need to test an MVC Controller Action that needs the Identity of the current user without mocking the HTTPContext. Solution: Create a custom Value Provider that allows access to the current user via an Action Parameter. Explanation: One of the goals of the MVC pattern is making the a... [More]
Having trouble testing my WPF app with Coded UI Test 17 September 2011 Donovan-Brown Work (0) Problem: I cannot find my WPF TextBlock using the Coded UI test because the value is data bound and changes. Solution: Set the Name attribute on the controls of your View which sets the AutomationId. Explanation: Many WPF developers only place the Name attribute on items they intend to access f... [More]
How do I validate data in my database during a web test 25 August 2011 Donovan-Brown Work (0) Problem: The only way I can verify the success of my web test is to read a value from a database. Solution: Create a custom validation rule that can validate the value in the database. Code: using System; using System.ComponentModel; using System.Data.SqlClient; using Mic... [More]
How to change the display name of my Find Text validation rule 03 August 2011 Donovan-Brown Work (0) Problem I can’t easily tell what my Find Text validation rule is searching for in my Web Test. Solution Change the DisplayName value in the Web Test xml to something more meaningful. From Solution Explorer right click on the Web Test and select Open With… then select XML (Text) Ed... [More]