How to pass in a count to dynamic json object

Viewed 97

Im very new to javascript. Im trying to make a way of counting from 0-5, and placing those numbers in a pair and then calling a function to click on boxes correlating to their index value. here is what i have so far:

* table deviceValsTable
     | boxLocator    | indexList |
     | brandCheckbox |   [0,1]   |
     | brandCheckbox |   [0,2]   |
     | brandCheckbox |   [0,3]   |
     | brandCheckbox |   [0,4]   |
     | brandCheckbox |   [0,5]   |
     | brandCheckbox |   [1,2]   |
     | brandCheckbox |   [1,3]   |
     | brandCheckbox |   [ect..]   |
 * def indexList = karate.get('indexList')
    * def locator = karate.get('boxLocator')
    * def boxes = locateAll(locator)
    * def clickBox = function(index){ boxes.get(index).click()}
    * karate.map(indexList, clickBox) 

I need to do this 16 times

1 Answers
Related