Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
FOR loop with nested CASE
#1
Not Solved
Hi All,

I have a unique situation where I must click on an image on the page to reveal the list of items then I have to set the webelement to the desired item in the list. I want to create multiple rows with a FOR statement and it works when I use the same item name each time:

Code:
for i =1 to 3
    datatable.setcurrentrow(i)
    returnvalue=datatable.value("invoiceNumber","Add_Multiple_Invoices")
Browser("Suppliers and Invoices").Page("Suppliers and Invoices").Image("spacer").Click
'Browser("Suppliers and Invoices").Page("Suppliers and Invoices").WebElement("Cleaning Supplies").Click


I want to incorporate a CASE statement or some code that will allow me to put a different value maybe from a table instead of it always being "Cleaning Supplies" . So something like this maybe :

Code:
for i =1 to 3
    datatable.setcurrentrow(i)
    returnvalue=datatable.value("invoiceNumber","Add_Multiple_Invoices")
Browser("Suppliers and Invoices").Page("Suppliers and Invoices").Image("spacer").Click
Select Case Category
        Case i = 1
returnCategory=datatable.value("Category","Add_Multiple_Invoices")

Any ideas on what I am doing wrong? The For Loop works, the Case does not.

Thanks,
Charles
Reply


Messages In This Thread
FOR loop with nested CASE - by wheelercha - 12-11-2009, 01:12 AM
RE: FOR loop with nested CASE - by nil - 12-11-2009, 10:23 AM
RE: FOR loop with nested CASE - by upadhyay40 - 12-12-2009, 10:45 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Infinit loop Suma Parimal 1 2,780 05-29-2014, 01:22 PM
Last Post: basanth27
  Exit Do loop shipu 1 4,902 12-20-2013, 06:33 AM
Last Post: basanth27
Smile Infinite FOR loop issue Sivapratha 3 4,446 04-01-2013, 09:44 AM
Last Post: basanth27
  Not Invoked particular Test Case kotaramamohana 6 4,208 12-30-2011, 05:39 PM
Last Post: ravi.gajul
  Do Until loop returning failure mitch 0 3,599 05-27-2011, 12:20 AM
Last Post: mitch

Forum Jump:


Users browsing this thread: 2 Guest(s)