0

We are looking to write automated tests using coded ui test framework. We are looking to test the ui components in isolation without launching the application in a separate process.

For example if we have a pop-up dialog in the application to capture data from user, we would like to launch only the specific dialog and validate different use cases rather than running the whole application.

We tried to test by launching the dialog as part of the test initialize() but it is not able to find the controls... but the same test works fine if I launch the dialog separately.

Have anyone tried this or have advise to get this working ?

1
  • Sounds like what you are trying to achieve is unit testing through GUI and this is not what Coded UI Test framework is all about. Commented Sep 17, 2013 at 8:25

3 Answers 3

2

Coded UI Framework is a very powerfull framework yet has lots (and I mean LOTS) of problems.

I wouldn't recommend it to do what you are trying to accomplish.

Besides, testing "components in isolation" is unit testing, and from my experience this is not a best practice for Coded UI Test at all.

Coded UI test will help you in testing cross-application processes from end to end, closest to the user as it gets since its simulating the users inputs though keystrokes and mouse clicks.

Also, as UI tends to change quite a lot during development, and Coded UI relies on that, I suggest you use it mainly for regression testing for windows you know that are not going to change anytime soon. This way you'll keep you maintainance low and productivity high.

Hope this helps.

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

Comments

1

Coded UI is intended for checking the functionality of applications (and also of web pages). Coded UI is not for testing fragments of UI separate from their application. However, it would be possible to create a test harness application that contained one or more UI components allowing them to be tested in isolation from the real application.

A test harness could easily have a window for each component being tested. The window would include the component being tested plus a some other simple controls. These simple controls could expose internal values of the component being tested and also be used to pass values into the component.

Comments

0

I think what your attempting to do is viable, however ONLY for your own custom controls. I think you should tackle this in this order.

  1. A second instance of VS to capture what it actually sees about your control when your test spawns your control.
  2. Update your search criteria, e.g. process name, window title
  3. Potentially add properties to your TestInitialize spawner so it creates your control with useful ID's, names, or titles. (not sure which tech stack your control is in)
  4. Run tests again

Comments

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.