Monday, January 27, 2020

ATF Parameterized Testing

Parameterized Testing within Automation testing framework is a feature that allows to run same Tests with different inputs thereby eliminating the need to copy the Tests. 

For example,  this feature comes handy if you wanted to automate the testing of a particular form.  the high level categorization of steps for it would be,

  • Open form
  • Fill fields
  • Submit the form.
Once you have the above steps configured, you can define different parameter test sets using which the steps will run multiple times for different inputs into the fields.  

As of NewYork release, there is a limitation that these parameters can't be accessed with Run Server Side Step.

In this article, I will describe how to define a custom step to take the advantage of parameterized test at Server Side.


New Step Config:


  • Navigate to Step configuration from left navigation menu and create a New Test Step Config





  • Define input variable to this step to pass parameters from the step to the Server script, for this article I have created 2 input variables.




  • Access newly defined input parameters in the Step definition script using the input object,  use these input variables as needed and define script as needed to process these input parameters






  • Lets test the above step configuration definition, so lets create a new Test, I have also defined  Exclusive Parameters and enable Parametersing testing




  •  I have created new Test step from the above defined Step configuration,  and tagged in parameters to the input variables.
 



Now the set up is complete, its to Test it with Test Data sets, I have defined the same and next screen to show the above set up has worked like a charm










Its not ideal to define a step configuration for each time you need to parameters at the Server Side but you can define a generic Test Config to club few use cases into one and also you can also define your input parameters as generic a JSON object and also another input param to pass script to be executed in the step config.  You get the idea.............







1 comment:

  1. Nice topics, thanks for posting in blogs, hope you can post more topics in servicenow.

    ReplyDelete

Most common interview questions and answers

 1. Tell me about yourself? This is [Your name] ,   I am a  specialist/expert in [your area] with [no of years]  experience and the [so and...