Answered

How to use a variable to fetch the data from data set.

Here is a scenario: From my test I will call a function by passing an argument. Then inside the function it has to read the value from the data set based on the argument. But I am unable to use the parameter variable while injecting from a data set in a print statement, because within Template injector we have select the field from the combo box.
For example, inside the test I am passing a value as "instructorUser", and the value for this field is available in the data set. So how can I get this value based on my argument.


FYI- My test path is : Home -> forteAutomation -> web -> validation -> forteValidation -> nasir_test

Could you provide any solution for this?

0
4 comments
Avatar
Joseph Hamdan

Hi Niranjan,

What is the main scenario? What are you trying to automate that leads to this structure ?

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Niranjan Das

Hi Joseph,

In my scenario, we have different category of users and accordingly there are different users. So each test will use different category of user so to my login function i will pass the category of user and accordingly the function will pull the appropriate user from the data set.

Please let me know if my explanation makes sense.

--Niranjan.

0
Comment actions Permalink
Avatar
Joseph Hamdan

Hi Niranjan,

So the scenario is to log in and out of an application in the same test case using datasets from the same templates or from different templates?

If you can provide a screenshot of a test case that can demonstrate it, that would be great.

Regards,
Subject7 Team

0
Comment actions Permalink
Avatar
Niranjan Das

Hi Jeseph,

Scenario is to login to the application using same template with different field and the field value should be a variable not the static value which can be selected from the combobox. In my case i am using a parameterised function. 

I am providing you couple of screenshots for your referrence.

 

In the following screenshot, i want something like ${automationUsers.userCategory}. Here userCategory is the variable in the function.

Thanks,

Niranjan.

0
Comment actions Permalink

Please sign in to leave a comment.