simond
simond

Reputation: 764

MTM test status not getting updated even if linked/binded coded ui methods pass/fail

I am trying to link coded ui methods with the actual written test case in test manager. But unfortunately i am not getting success.

Can you please help me to find what i am missing?

I have followed below steps:

  1. I have written test cases in test manager
  2. I have coded ui project solution which is checked in into the tfs under same collection where my test cases are.
  3. I have added method like below which call browser launch and then perform some operation then if success then pass or else if fails.

    [DataSource("Microsoft.VisualStudio.TestTools.DataSource.TestCase","http://[servername]:8080/tfs/collection];[project]", "6546", DataAccessMethod.Sequential),TestMethod]
            public void method2()
            {
    
                    Playback.PlaybackSettings.ContinueOnError = true;
                    Driver er = new Driver();
                    er.Cos_Main(TestContext.DataRow["TestCaseID"].ToString());
    
                    string x = null;
            }
    then 
    in cos_main()
    launch browser;
    if()
    //success
    else
    // assert.fail();
    
  4. then i have opened same test case with ctrl+g i.e go to test case and over there in added associate automation option linked that coded ui method2

  5. now my test is running but test manager status is not getting updated
  6. before creating project i have checked both the checkbox for add to source control and other but still looks like missing something
  7. reading same test cases number manually from excel which is ok, but when assert.fail() executes it is not updating status in test manger .

    please could you please tell me some missing from me?

    Thanks in advance

Upvotes: 1

Views: 668

Answers (1)

Elena
Elena

Reputation: 1946

5) now my test is running but test manager status is not getting updated

How do you start the tests?
Please check this article: Running automated test.
Are you starting your tests using one of the ways described there?
(Please note, if you just run your test method locally using Visual Studio test runner, MTM will not get any information about this.)

If yes, then it sounds like you are checking the status at the wrong place in MTM.

Each time you run an automated test a new test run is created and it is the status of this test run that show you if your test was successful or not.

Here is a right place to check the results:

enter image description here

Please check View and update tests results for more details.

Upvotes: 1

Related Questions