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

How to Configure Tests and TestLists?

1 Answer 100 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Ray
Top achievements
Rank 1
Ray asked on 07 May 2020, 08:29 PM

I am struggling with finding the best way to configure my tests dynamically.

I am logging into one of 4 or 5 servers. Sometimes I can use the same username/password pair and sometimes I cannot. I would also like to set environment variables specific to each environment. The only way I can do it now, is this. Say I have a "MyWebTest" to run. The first step is a code step that can log in and set variables. Everything after the login is in MyWebTestStep. What I have to do now is create 5 tests:

MyWebTestAAA: (1) LoginStepAAA (2) MyWebTestStep

MyWebTestBBB: (1) LoginStepBBB (2) MyWebTestStep

MyWebTestCCC: (1) LoginStepCCC (2) MyWebTestStep

and so on. This seems lame.

 

Or I can have the LoginStep do all of the configuration.

 

If I am running a test as a test, I have the 3 properties: CustomProperty1, CustomProperty2, CustomProperty3. I can put information in those and pull out the configuration info that I want.

 

If I am running a test within a test list, there is only one property that I can use, or mis-use. That the is baseUrl. Nothing else allows me to add arbitrary text. I can put http://url.com?env1=this&env2=that. And then I can put information in those and pull out the configuration info that I want.

But what I would like is o have only one "MyWebTest" and run a test list and, within that, run "MyWebTest" configured for AAA, the run in configured for BBB and then run it configured for CCC and I cannot do this. Again, I want to do this without having to create multiple copies of "MyWebTest".

 

If I do something using the custom properties, I can only use it when running as a test. If I use the baseUrl, I can only use it when running as a test. If I do both in different places, these things fight against one another. Is there a reasonable way to do this?

 

1 Answer, 1 is accepted

Sort by
0
Elena
Telerik team
answered on 12 May 2020, 01:49 PM

Hello Ray,

Thank you for sharing detailed description of what requirements you need to cover and how you tried to cover these so far. 

Based on our other discussions I am aware that you are trying to reuse as much of the prepared tests as possible, which is truly a great practice. To extend your automation solution even more, you can prepare a custom Execution extension to tailor up your needs. This is a solution which allows you to implement certain actions to be performed before or after a test list run and/or before and after a test list execution using the respective methods provided in the Execution extension provides in the IExecutionExtension interface. 

As one example of such custom Execution extension, you can use the sample listed in the article how you can use the OnInitializeDataSource method. Another useful source you can refer to is an extension example, which will rerun any failed tests from a test list run - please, note that this feature is already added in Test Studio ou-of-the-box and can be enabled in the test lists settings for each test list. Though, the sample can be used to demonstrate the usage of the extension.  

Please, consider the specifics of the execution extension usage if you intend to implement this in a remote setup for running the tests.

Please, explore the suggested approach and try to customize the test and test list runs as per your needs. Of course, if you need further assistance on such implementation, do not hesitate to continue the conversation sharing any difficulties you might face. 

Thank you for your cooperation in advance.

Regards,
Elena
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
Ray
Top achievements
Rank 1
Answers by
Elena
Telerik team
Share this question
or