This is a migrated thread and some comments may be shown as answers.

Dynamically execute and create tests

3 Answers 34 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Matt
Top achievements
Rank 1
Veteran
Matt asked on 28 May 2020, 06:41 PM

Hi Everyone,

we have a very large .Net Core MVC app and a lot of the tests could be made easier if we had a way to dynamically create the tests (vs recording or putting it all in by hand). Here is the scenario:

 

  • We have many controllers which have data entry/index screens all of which are of one of five types
  • The url is always uri/<Controller Name>/Create or Edit or Index etc.
  • We know all the pieces that make up the controller names and we know which ones have what functionality. Not all are the same, but 85% can run off of similar tests. Is there a way to call a test, dynamically change the URL during runtime from a list of names, then record the result against that somehow?

Thanks

3 Answers, 1 is accepted

Sort by
0
Plamen Mitrev
Telerik team
answered on 29 May 2020, 12:03 PM

Hi Matt,

Thank you for explaining about the application and what you want to achieve. I am happy to tell you that it is possible to configure your tests to achieve this automation scenario, by utilizing some of Test Studio's features. Please take your time to go through the below details and linked articles and experiment on your end. Of course, you can follow up with any question that might arise.

Multi-level testing:

Tests in Test Studio can be data driven and that helps you automate more scenarios with different values and iterations. You can also create a multi-level structure that allows you to create even more complex scenarios. All web tests can inherit one or more tests as step, without any limit to the number of levels of inherited tests. For example, test A can have test B as a step, which has test C as a step and so on.

Each of those test can either be data driven, so the steps (like the navigation step) can be bound to data from local or external source, or it can inherit the data from its parent test. That is how you can additionally control the flow of iterations and experiment what is the best configuration for your test scenario.

Page nodes:

During the recording, Test Studio saves all elements under a specific page node in the Elements Explorer. This structure is controlled by the CompareMode for the URL. Each of those page nodes has its unique properties that help the execution find the correct target element on that page. However, that could cause some troubles, if you want to use the same element that exists on a similar page. So, to overcome this, you need to configure the page nodes' properties to only validate part of the full URI by using tilde "~" sign and the common part of the URL.

Data driven find expressions:

You can configure the element's find expression to be data driven and help you find the target element dynamically. Please check the details shared in this article and consider this for your test scenario.

Code steps and execution extensions:

The coded steps and execution extensions allow you unlimited possibilities to write your own C# or VB code and implementation for the test scenarios. It can work in combination with the above mentioned features as well. You can have custom conditions or criteria to execute actions and verification dynamically.

I hope the above details will help you find the approach for your test automation that is easiest to create and maintain. It depends on the specifics of the application and test scenarios that you want to cover. Please do not hesitate to contact us again, if you have any follow up questions or concerns.

Regards,
Plamen Mitrev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
0
Matt
Top achievements
Rank 1
Veteran
answered on 29 May 2020, 04:49 PM

Plamen,

thanks for the detailed response. I figured there were ways to do this and I'll take a look at your suggestions ;-)

 

Matt

0
Plamen Mitrev
Telerik team
answered on 01 Jun 2020, 05:32 AM

Hi Matt,

Please take your time to explore the most suitable suggestions for your scenario and experiment locally on a smaller scale. Of course, if you have any follow up questions or concerns, do not hesitate to contact us again.

Have a great week.

Regards,
Plamen Mitrev
Progress Telerik

Progress is here for your business, like always. Read more about the measures we are taking to ensure business continuity and help fight the COVID-19 pandemic.
Our thoughts here at Progress are with those affected by the outbreak.
Tags
General Discussions
Asked by
Matt
Top achievements
Rank 1
Veteran
Answers by
Plamen Mitrev
Telerik team
Matt
Top achievements
Rank 1
Veteran
Share this question
or