简体   繁体   中英

Associating test cases with test methods when using [TestClass] rather [CodedUITest]

We are using Unit test project for UI automation using selenium web driver.

I can execute test from visual studio Test >Test Explore > Select the Test and Click on Run.

I am not able to Associate the Test case to the Test method From Unit Test Project which were developed in Unit Test project.

We are using Visual Studio 2017 Professional version in this we are able to see the option 'Associate Test case' in disable mode ( Test > Test Explore > Right click on any unit Test method > Associate To Test case )

Please suggest the solution for associating the Test cases.

You need to create a test project containing your automated test, then build it. See the supported test types: What types of tests are supported?

Just follow the steps mentioned in this link to sssociate your tests: Associate automated tests with test cases

Associate your test

If you know the identifier of the work item for the test case:

  1. If the Test Explorer window is not displayed, open it from the Test | Windows menu.
  2. If your tests are not displayed in Test Explorer , build the solution.
  3. In Test Explorer , select the test method you want to associate and choose Associate to Test Case .
  4. In the dialog that opens, type the test case identifier and choose Add Association , then choose Save .

If you do not know the identifier of the work item for the test case:

  • Ensure you have configured Visual Studio to display test work items inside the Visual Studio editor rather than in your web browser. See
    Can I configure work items to open in Visual Studio?
  • In Team Explorer open the Work Items tab. If the Team Explorer window is not displayed, open it from the View menu.
  • Expand the list of Queries in the Work Items tab to find one that displays your test cases, for example the default My Test Cases query. For more information about how to use queries in Team Explorer, see Use the query editor to list and manage queries
  • Execute the query by choosing View Results on the shortcut menu (or double-click the query name).
  • Open the test case you want to associate by choosing Open on the shortcut menu (or double-click the test case name).
  • In the work item, open the ASSOCIATED AUTOMATION tab. All the tests in the solution are shown in the list together with their associated test projects.
  • Choose the ellipsis ( ... ) and, in the Choose Test dialog, select the test and then choose OK. The value in Automation Status is automatically changed to Automated .
  • Choose Save Work Item to save the changes to the test case.

Source link : Associate automated tests with test cases

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM