Re arranging tests in Embedded api project in Progress Telerik project

1 Answer 64 Views
API Testing General Discussions
Ruth
Top achievements
Rank 1
Ruth asked on 20 Jul 2021, 09:25 AM

Good morning,

 

I would like to organize the embedded api project in respective folders for tests to be organised.  How can this be done with the least impact to the UI? How can i identify which UI tests are calling the api's to adjust the path?

 

Thanks

Ruth

1 Answer, 1 is accepted

Sort by
0
Plamen Mitrev
Telerik team
answered on 21 Jul 2021, 10:48 AM

Hello Ruth,

You can edit the Embedded API project from the Test Studio project's context menu and create the appropriate folder structure. If you move the API tests to different folders, the tests that were already referenced in a web test, will have their paths broken. There are two ways to fix the paths of the API test as steps in your Test Studio project.

  1. Open the web test that references a relocated API test as step and select that step. Change the TestPath property from the Properties pane to the new location of the API test in the embedded API project (see TestPathForAPIStep.png). 
  2. Open the web test that references a relocated API test as step and convert this step to code. This will generate a coded step with similar code to the one below. You can change the test path string from there.
    // Execute API test 'Test2'
    System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<string, string>> variables = new System.Collections.Generic.List<System.Collections.Generic.KeyValuePair<string, string>>();
    this.ExecuteApiTest(".\\ApiTestFolder\\Test2", variables);

The TestPath property can also be used to check which APITest is referenced in the API test as step. There is no global way of checking the links between APITests and API test as steps in the UI.

I hope the above details and suggested approaches will be helpful to you. Let me know if you have any follow up questions.

Regards,
Plamen Mitrev
Progress Telerik

Virtual Classroom, the free self-paced technical training that gets you up to speed with Telerik and Kendo UI products quickly just got a fresh new look + new and improved content including a brand new Test Studio course! Check it out at https://learn.telerik.com/.
Tags
API Testing General Discussions
Asked by
Ruth
Top achievements
Rank 1
Answers by
Plamen Mitrev
Telerik team
Share this question
or