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

Test case with input parameter like function

4 Answers 193 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
WY
Top achievements
Rank 1
WY asked on 24 Jul 2015, 07:06 AM

Does test studio have some feature to achieve this: use test case like a function, create step with custom input parameter.

I know data source can somewhat do this, but it is not flexible.

Suppose we want create a scenario, User A login the system, publish a product, User B login to buy the product, User A login the process the order. A and B can vary from time to time.

Can we easily achieve this by assembling steps?

4 Answers, 1 is accepted

Sort by
0
WY
Top achievements
Rank 1
answered on 24 Jul 2015, 08:19 AM

Is it possible to enter a $(variable) to a control?

just like Enter text '$(someText)' in 'KwText'

0
Cody
Telerik team
answered on 28 Jul 2015, 04:36 PM
Hello,

I apologies for the delay getting back to you on this. We were temporarily overloaded for the last week.

For your first question, yes we have the Test-As-Step feature. You can pass it parameters from the parent test via multiple methods:
  • Check the InheritParentDataSource property - When this is turned on the child test gets all the data rows that the parent test gets when using data binding.
  • Extracted Variables - These are stored in a global data dictionary and exist for the entire life of the test. Both child tests and parent tests have access to these variables. They can also be set via a coded step.
  • Your own custom code - You could implement your own code to pass a variable from a parent test to a child test using standard programming methods e.g. create a global variable in code which can be accessed anywhere by any other code.

 Is it possible to enter a $(variable) to a control?

That's exactly what our Extracted Variables were designed to handle.


Regards,
Cody
Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
0
Michael
Top achievements
Rank 1
answered on 13 Jun 2018, 09:01 PM
In Katalon Studio, each test has its own variable namespace, such that we can set a variable on one test, and that won't affect the state of that variable on another. Is there any means of doing so with this PAID software? 
0
Elena
Telerik team
answered on 18 Jun 2018, 02:17 PM
Hello Mark,

Thank you for reaching us out. 

Test Studio does not use such terminology as namespace for the variables. Though the possible approaches Cody had described cover the idea you had listed - an extracted variable and its value can be used in the current test execution. This means it could be also passed to any nested tests as step in it. 

Alternatively if there is a variable you would need to use in another test which is not a sub test of the one which assigns its value, you could include a class file in the project and define the variable in it - that way it will be accessible across the whole project. Though you should keep in mind when packing tests in a test list there is a test which sets value to the variable before a test which uses that. 

I hope this makes sense to you. Though if you have any further questions please let me know! Thanks! 

Regards,
Elena Tsvetkova
Progress Telerik
 
The New Release of Telerik Test Studio Is Here! Download, install,
and send us your feedback!
Tags
General Discussions
Asked by
WY
Top achievements
Rank 1
Answers by
WY
Top achievements
Rank 1
Cody
Telerik team
Michael
Top achievements
Rank 1
Elena
Telerik team
Share this question
or