12-11-2009, 01:12 AM
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:
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 :
Any ideas on what I am doing wrong? The For Loop works, the Case does not.
Thanks,
Charles
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