1

I need help with the following:

  • Automated Testing using the Visual Studio Coded GUI
  • Setting up Test Settings/Agents to run virtually on a VM to run the tests (like being logged in, but not)
  • Getting help with element examination (like differentiating between some developer using 'toolStrip1' as the ID in three different places on the GUI)
  • I was successful with Selenium, C# in visual studio using the phantomjs or ieserver driver, but that was for Web Apps.

So I know I can do this but now I need to setup framework for Desktop APPs. I have some GUI Desktop automation running. The not-too-hard to get at elements, and I launch them remote test using psexec->vm (.bat file) which implements my test(s) using vstest. Works great. But I pass login credentials while I am leaving a user logged in - I hear that agents do this so now I will be "headless". Also it really bothers me that a developer left a 'toolStrip1' ID for three different toolstrips on the app. ANY help will be greatly appreciated.

1 Answer 1

1

Point 1 : Automated Testing using the Visual Studio Coded GUI

For starters ensure you're running the latest Visual Studio (Including all the patches). Don't try and pull this off with VS2010 or VS2012. Also you will need VS2013 Premium, I have not yet looked at VS2015.

Here it's pretty simple to record the controls to your UI Map. As for the recordings I wouldn't bother recording them. Only use the recorder for control identification and then write the actual tests by hand.

Your success is heavily dependent on what controls are in your WinApp. For example are you using Telerik or DevExpress or Standard .Net Winforms? Perhaps even a C++ WIn32 App? This is because controls like DevExpress do not use MSAA but expose their own technology type with better properties and methods exposed for testing. WIth MSAA it depends heavily how the developer implemented accessibility to expose the correct properties and methods. So if they haven't done any exposure on a C++ Win32 App, then it's unlikely any nested composite controls will have enough exposure for you to easily test the application.

Point 2: Setting up Test Settings/Agents to run virtually on a VM to run the tests (like being logged in, but not)

Your best route here is to use a full blown labs environment. Then execute your tests using MTM (Microsoft Test Manager).

So the basic topography is like this:

  1. You'll need a TFS Build Server (Consisting of a build controller and an agent)
  2. A Test Controller
  3. A Test Agent

Register the build environment with TFS, then in Visual Studio, once you've checked your code into TFS, Queue a new build.

Your Test controller should be registered with TFS, but your test agents DO NOT get registered to the Test controller. Instead they should be setup in Labs environment (part of the MTM GUI).

This way once you've assigned a build to a project (Using MTM -> project -> properties), and setup your agents (and installed TFS agent inside an agent), and created test environments (MTM), you can right click and run tests using MTM.

However there are a few pitfalls, you can in theory get the tests to run with autologin, but this is ridiculously unreliable inside a VM. Unless you have a physical test machine, every time you run tests using MTM, it's best to open and minimize the lab environment.

Point 3 : Getting help with element examination (like differentiating between some developer using 'toolStrip1' as the ID in three different places on the GUI)

This will not be a problem if you use the recorder to identify controls. This is because CodedUI uses a lookup chain and search patterns to identify controls. It does indeed check the parent -> child relationships.

Sign up to request clarification or add additional context in comments.

1 Comment

Hey wow - excellent response and timely. Thanks for that. I will participate (Help) as much as I can in the future as I am new to this site. Already have a "Build Server" so I can work from there. Thanks also for the suggestion to go with 2013 Premium - saved me time.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.