I have the following code which I add CART item with a coupon code, but I want to put a loop when I have for example items in the cart and it will delete my old items and insert the new items and how do I know how many items the user has
<td>store</td>
<td>30</td>
<td>loop</td>
<td>store</td>
<td>20</td>
<td>i</td>
<td>while</td>
<td>${i}<${loop}</td>
<td></td>
<td>click</td>
<td>link=Sales</td>
<td></td>
<td>clickAndWait</td>
<td>link=Sales Panel</td>
<td></td>
<td>readCSV</td>
<td>file:\C:\Users\Numg\Desktop\webusers\web-users_1.csv</td>
<td></td>
<td>storeCellValue</td>
<td>id</td>
<td>${i},1</td>
<td>echo</td>
<td>${id}</td>
<td></td>
<td>click</td>
<td>id=web_user_user_id</td>
<td></td>
<td>type</td>
<td>id=web_user_user_id</td>
<td>${id}</td>
<td>pause</td>
<td>5000</td>
<td></td>
<td>clickAndWait</td>
<td>link=Ok</td>
<td></td>
<td>waitForPageToLoad</td>
<td>100000</td>
<td></td>
<td>click</td>
<td>id=4</td>
<td></td>
<td>pause</td>
<td>5000</td>
<td></td>
<td>select</td>
<td>id=aggrupations_639_shares</td>
<td>label=3</td>
<td>clickAndWait</td>
<td>css=#bet-group > #send > i.fa.fa-arrow-right</td>
<td></td>
<td>storeElementPresent</td>
<td>id=code</td>
<td>editvalue</td>
<td>echo</td>
<td>${editvalue}</td>
<td></td>
<td>gotoIf</td>
<td>${editvalue}==true</td>
<td>StepsWithEdit</td>
<td>gotoIf</td>
<td>${editvalue}==false</td>
<td>StepsWithoutEdit</td>
<td>label</td>
<td>StepsWithEdit</td>
<td></td>
<td>type</td>
<td>id=code</td>
<td>123QA</td>
<td>clickAndWait</td>
<td>css=#new_reduction > input[name="commit"]</td>
<td></td>
<td>label</td>
<td>End</td>
<td></td>
<td>label</td>
<td>StepsWithoutEdit</td>
<td></td>
<td>clickAndWait</td>
<td>link=Cancel</td>
<td></td>
<td>label</td>
<td>End</td>
<td></td>
<td>type</td>
<td>id=code</td>
<td>123QA</td>
<td>clickAndWait</td>
<td>css=#new_reduction > input[name="commit"]</td>
<td></td>
<td>clickAndWait</td>
<td>link=Clear</td>
<td></td>
<td>pause</td>
<td>5000</td>
<td></td>
<td>storeEval</td>
<td>${i} + 1</td>
<td>i</td>
<td>endWhile</td>
<td></td>
<td></td>
This is deleted code:
<td>clickAndWait</td>
<td>css=input.button</td>
<td></td>
<td>clickAndWait</td>
<td>//input[@value='Delete']</td>
<td></td>
<td>clickAndWait</td>
<td>//input[@value='Delete']</td>
<td></td>