0

How to Put paramaters for the MTM test case in excel sheet and call them instead of having them by defining @parameter in test case.

Can it be done by coded UI ? if so how and where to change the file location?

3 Answers 3

1

No, you will not be able to do this using MTM only i.e. using the MTM functionality you can't feed your test cases with external sources like an Excel/CSV etc, atleast till version 2013 this functionality is not available. MTM is just a simple recorder which has been designed and provided to help manual tester to ease and accelerate their job of manual testing. All validations (Pass/Fail) still needs to done manually by the tester.

If you want to do Data Driven testing, then you need to take your test cases one step ahead by using Coded UI, it will provide you a lot of features, frameworks and flexibility for creating and maintaining test cases. Using Coded UI you will have two options of doing this.

One is to use the record and playback functionality of Coded UI and then generating code from the recorded test cases. Even, in this step you can save time by using the already recorded test cases of MTM and converting them to Coded UI. You just need to select the option 'Use an existing action recording' over the code generation screen and it will save your time of recording.

enter image description here

By this way your test cases will be available in both MTM and Coded UI. Reference links:

Already mentioned in earlier answer

http://decisivedata.net/blog/data-driven-coded-ui-test/

Another option is to use the excel sheet via code in Coded UI test cases. For this you need to write code for using the excel file and pass it to your fields.

Reference link: https://stackoverflow.com/questions/23269093/data-driven-coded-ui-test-with-excel-file-as-a-data-source

0

Yes, this can be done using CodedUI. There is an excellent, step-by-step instruction here: https://msdn.microsoft.com/en-us/library/ee624082.aspx

See the DataSource examples at the bottom to see how to specify the file location.

0

It looks like something on the lines that you are after has been implemented in the 2014/2015 branch. I`ll leave some links below so you can take a look for yourself.

I am currently on 2012 and I don`t have that. It looks like we might need to upgrade :)

Links:

https://msdn.microsoft.com/en-us/library/dd997832.aspx#SharedParameters https://www.visualstudio.com/en-us/news/2014-may-20-vso https://www.visualstudio.com/en-us/news/2014-apr-3-vso

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.