Forum Discussion
So, let me see if I understand.
You have a reusable keyword test with one of these data loops. the data loop points to an excel sheet. That excel sheet has 5 rows. You have 5 products you're testing. When you run a test for product 1, you go in and edit your tests to use row 1 through row 1. When you run a test for product 3, you edit the test to use row 3 through row 3.
So... in other words, they aren't exactly loops but simply external storage of parameters to be used for the test case. You're not looping, within the test case, for all 5 products.
What I would do, actually, is instead of using a data loop, add parameters to your keyword tests and then use those parameters instead of data loops. When you add the resuable keyword test to a project for, for example, product 4, you would simply use a different set of parameters rather than having to point to an excel sheet.
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?
- techgirlbb7 years agoContributor
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
Related Content
- 5 years agoloridee
- 8 years agoBhuvanShanmugam
Recent Discussions
- 42 minutes agodhundley