Главная | Обратная связь | Поможем написать вашу работу!
МегаЛекции

Running automated tests. Configure Test Plan for automated testing. Automate a test case. Recording your actions during a test run




Running automated tests

Configure Test Plan for automated testing

 

Note: Before configuring an Automated Test Plan, you must create Environment from Lab Center (Create a lab Environment).

 

1. In the Testing Center click on the Properties.

 

2. Under the Automated runs: in the Test settings combobox choose < New…>.

 

3. Complete the name of the configuration and select the Automated type of test.

 

 

4. Choose the Environment and select the Web Client Role to run automated tests.

 

5. For each role in the test environment select needed data to collect, or actions to perform on the system. For more information, click here.

You can pass this step in case if you don’t need to collect data from automated test.

6. Advanced and Summary step can be omitted and therefore click Finish button.

7. In the Test environment choose existingenvironment.

 

Automate a test case

 

To automate a test case, we need to link it to a coded test method. You can link any unit test, coded UI test, or generic test to a test case. You’ll want to link a test method that performs the test described by the test case.

Before linking coded UI test to a test-case, we need to perform a manual test and record all the actions.

Recording your actions during a test run

 

In the Start Test window, select Create action recording.

 

Make sure to mark each step Pass or Fail as soon as you have completed it, and choose End Test when you’ve completed the last step. This makes sure the recording assigns your actions to the correct steps.

If you make a mistake

Open the editing panel at the bottom of test runner. You can delete actions there:

Alternatively, you can run the test again and choose Overwrite action recording.

 

If the test includes shared steps

You have to indicate when you finish recording the shared steps:

If the steps include parameters

If the parameter specifies text that you have to type as a step in the test, then it will be recognized and bound into the recording. When the recording is played back with another set of parameter values, the new value will be entered instead.

But the parameter won’t be bound if it is not directly entered as text– for example, if it’s the name of something you select. When the recording is played back, you’ll have to perform that step manually.

Playing back an action recording

Select your test and run it. Don’t check the overwrite option in the Start Test dialog.

You can play the whole test, or play individual steps. Test Runner will replay the keystrokes and gestures that you recorded.

You have to verify the result of each step. The recording doesn’t verify the outputs.

 

           Link Coded UI test with Test-Case

 

Generate Coded UI test from a Test-Case

1. Open Visual Studio 2013.

2. Create a new test project (File | New | Project... ).

3. In the New Project window, select the template Coded UI Test Project from the Visual C # | Test and click the button OK, to create a test project.

4. There are two methods for creating the code for the new dough encoded IR. The first parameter to use the default Coded UI Test Builder, which allows you to create test code manually going through a test scenario. The second option is to use the existing record of action. Select the second option - use an existing account, and then click OK to continue.

 

5. In the Work Items Picker, select the project.

6. Select the radio button IDs, enter the Id of a test-case and click Find.

 

 

7. Click OK to generate the coded UI test of the recording action.

8. Go to the method in the generated file CodedUITestMethod1 CodedUITest1. cs. Each line represents a step of recording action, used in generating tests.

9. Right-click anywhere in the source file CodedUITest1. cs and then click Run Tests. Do not touch the keyboard or mouse during the test.

 

 

Поделиться:





Воспользуйтесь поиском по сайту:



©2015 - 2024 megalektsii.ru Все авторские права принадлежат авторам лекционных материалов. Обратная связь с нами...