Thursday, 14 July 2016

__setProperty & __property

           If we have multiple threads in our application and we need to define global variable so that every thread have access to the variable,we may use "__setProperty" function in one thread to set the variable value and then use "__property" function to get the variable value in different thread

Hypothetical Scenario:
 Use user password set at thread 1 in Thread 2

Functions are defined as below

Set Property:

${__setProperty(userpassword,*password*,)}

where,
  1. Property name:  userpassword
  2. Property value: *password*
Get Property:
${__property(userpassword,,)


So we will use set property function to set the property in one thread and use get property function to access the password value in other thread.


Test Plan :

We have set user password in one of the request.So "userpassword" has been assigned with value "*password*"



Now we will use get property function to use the set password in thread 1 in thread 2



Now if you execute your test script,this should successfully run.



No comments:

Post a Comment