Question

Is there a way to integrate Visual Studio 2010 Coded UI Test with Specflow? I am not sure if these 2 can hook somehow.

I have this idea to Create a Data-Driven Coded UI Tests by using some Coded UI API (I don't know yet what) and hook it up into Specflow. I have to revisit the video Specflow guys had last year to see how all can fit together and I would appreciate some input, ideas.

Does this has to do with creating unit test providers for Specflow like the one below (since Coded UI work in VS 2010): MsTest.2010 MsTest version for .Net 4.0. Supporting test-categories.

Will unitTestProvider (generatorProvider and generatorProvider) be that connection?

Or simply these 2 won't mix and are competing or different ways to do integration or acceptance testing. Is Coded UI Tests actually close to running Specflow via selenium for UI automation test with additional benefit that the code is generated for you.

I just want o gain the benefit of Coded UI Tests (maximize its feature both at design and run time) and Specflow (again design and run time)

(More about this on Microsoft site) Create a Data-Driven Coded UI Test http://msdn.microsoft.com/en-us/library/ee624082(VS.100).aspx

Using Visual Studio Premium or Visual Studio Ultimate, you can create a coded UI test that tests whether the user interface (UI) for an application functions correctly. The coded UI test performs actions on the user interface controls for an application and verifies that specified controls display the correct values. For more information about how to create a coded UI test, see How to: Create a Coded UI Test.

After you create your coded UI test with specified data, you might want to run your coded UI test multiple times with different sets of data to test different conditions. To do this you can add parameter values from a data source to create a data-driven coded UI test. Each row in the data source is an iteration of the coded UI test. The overall result of the test will be based on the outcome for all the iterations. For example, if one test iteration fails, the overall test result is failure.

For more general information about data-driven tests, see How to: Create a Data-Driven Unit Test. (http://msdn.microsoft.com/en-us/library/ms182527.aspx)

Thanks, Rad

Was it helpful?

Solution

Basically what you need to do is:

  1. Create a custom generator to decorate your test classes properly
  2. Ensure the Coded UI API is initalized during any SpecFlow hooks you call

I have a solution on how to do both of these on the SpecFlow wiki: https://github.com/techtalk/SpecFlow/wiki/Using-SpecFlow-with-CodedUI-API

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top