Forum Discussion
Oh wait, you don't want to clone the scripts. You shouldn't have to change the test number every time, that's definitely tedious. Can you give us a more detailed example of how this would be run on a daily basis?
Marsha, Thank you for trying to help with my current issue. Here is some more information:
we have around 20 products and each product contains has min 10 to 14 screens based on product selected. so I have created individual keyword scripts so that I can reuse them using script routine for each product.
I did not go with approach of creating one script all through 15 screen to work data loop, because flow is not same across all the products.
As well these products are run by couple of team members at the same time from their systems by sharing products
like executioner 1- from 1 to 10 products
like executioner 1- from 11 to 20 products
I generated the script(Java script) for keyword tests that has Data loop. I am not seeing the file name that I have provided using data loop wizard.
Is there an option for me to utilize the Java script and passing the different files?
Pls find the attachment which we have in currently..
I though of calling the keyword script and passing
- Marsha_R7 years agoChampion Level 3
I agree with tristaanogre that I don't think you need a data loop here at all. You would use that if you wanted to perform some tests over and over on one product, using a different line of data each time. What you have is a collection of data to be used in the same test on a different product each time.
Rather than having the values Prod1, Prod2 and so on in that first column, is there a product name or part of a name that you can read off the application that you could use in there instead? For instance, if you are logging into Prod1 you launch it and it is called MyProduct1 in the window somewhere, then I would change that first column to MyProduct1 in the Excel sheet. Then when you launch the application inside the test, the test can read the product name and use that string to look up the correct line in the Excel sheet.
This will let you run the test on each product but not have to stop and tell the test each time which product and Excel line to use. It will be smart enough to know on its own.
Does that make sense?
ETA: You may still need the loop there in order to allow searching for the correct product line, but at least you will not need to enter a product number every time.
- techgirlbb7 years agoContributor
Marsha,
Yes we have product names which are unique Ex: Auto, Homeowner..ctc.and Each product has unique set of data. I can read the product name only after initializing the application..
"For instance, if you are logging into Prod1 you launch it and it is called MyProduct1 in the window somewhere, then I would change that first column to MyProduct1 in the Excel sheet. Then when you launch the application inside the test, the test can read the product name and use that string to look up the correct line in the Excel sheet."
Can you guide with steps how to read and update excel. And also changes need to make in the test to read the product name and use that string to look up the correct line in the Excel sheet
In advance really appreciated your help
- Marsha_R7 years agoChampion Level 3
I don't know javascript but I can give you a general idea
Create a project variable called ProductName and then do something like this
*whatever you do to start application*
Set variable ProductName = product name as read from window
DDT loop
while (not out of Excel lines) and (Excel.FirstColumn.Value not equal to Project.Variables.ProductName
next DDT /* stop when you find the right product or if it's not found at all*
If Excel.FirstColumn.Value = Project.Variables.ProductName then
use Excel values to log in
Else
product wasn't found in Excel, log error
*other test steps follow here*
If you need javascript syntax, someone else will have to jump in. :)
Related Content
- 5 years agoloridee
- 8 years agoBhuvanShanmugam