2

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}&lt;${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 &gt; #send &gt; 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 &gt; input[name=&quot;commit&quot;]</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 &gt; input[name=&quot;commit&quot;]</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>
  • kindly please post this question here stack Overflow – quintumnia Mar 20 '17 at 13:06
  • 2
    Here is how to loop tests in the Selenium IDE: stackoverflow.com/questions/11033321/… – Bobby231 Mar 20 '17 at 13:46
  • Bobby231, can you please put that link as an answer since it seems to clearly be covering looping in Selenium IDE? – mutt Mar 20 '17 at 17:43
  • @quintumnia You may not be aware of this, but this site actually was merged into the Selenium site 5 years ago. Any question relating to Selenium is on topic here. – corsiKa Mar 21 '17 at 6:24
  • @corsiKa That's cool! though the second comment wants the question there! – quintumnia Mar 21 '17 at 6:31
1

Here is how to loop tests in the Selenium IDE:

https://stackoverflow.com/questions/11033321/how-to-loop-tests-in-selenium-ide

From the above post:

The js file provides goto, gotoIf and while loop functionality in Selenium IDE.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.