2

I have scenario where whole test cases has shared (global) parameter which changes based on Test rounds with MTM.
So here we can say shared parameter is a common parameter based on Test round

For example

Test Round 1 globalVar="abc" executes TC1,TC2,TC3 for "abc"  
Test Round 2 globalVar="pqr" executes TC1,TC2,TC3 for "pqr"  
Test Round 3 globalVar="xyz" executes TC1,TC2,TC3 for "xyz"

I want to use this globalVar in automation in such manner that when we execute:

-Test Round 1,  test cases will execute for globalVar  ="abc".  
-Test Round 2,  test cases will execute for globalVar  ="pqr".  
-Test Round 3,  test cases will execute for globalVar  ="xyz".

Now I have few queries:
1) Is it possible to change or pass globalVar value dynamically in MTM based on Test round?
2) How do we use shared variable globalVar in coded UI test cases?(Need piece of code)?
3) Is it possible to define common global variable for test cases while writing test cases in codedUI, which we can change dynamically while execution of test cases in MTM?

1 Answers1

0

I believe you could do this by data driving your tests and then modifying the data file from within the test.

  1. I'm not sure about dynamically changing variables in MTM, but you can definitely use MTM as a Data Source.

  2. MS Test framework has built in functionality for data driven tests.

    https://msdn.microsoft.com/en-us/library/ee624082.aspx

  3. You would use and modify the same data source for multiple tests.

Community
  • 1
  • 1
Drew
  • 66
  • 5