Question : Setting parameters in a drop down list

Hi sailingbye,

Sorry when I read 33136571 I didn't fully understand it. Now I've submitted your comment as the solution.

I have a related question about setting parameters in a drop down list.
The second page I open after clicking the button is full of input text boxes and drop down lists.
I have no problem setting paramenters in the first one, but when I try the same method for the drop down list it doesn't work.  Code here:

Form2.setParameter("txtProjectName", "blend");
assertEquals("blend", Form2.getParameterValue("txtProjectName"));
System.out.println("Set paramenter Project Name to 'blend'.");
                        
Form2.setParameter("cmbProducts", "1");
String currentValues[] = Form2.getParameterValues("cmbProducts");
assertEquals("Parasolid", currentValues[0]);
System.out.println("Set paramenter Products to 'Parasolid'.");

First 3 lines are ok, for the second block of code the problem is I get this message after compiling (coming from the assert line):
junit.framework.ComparisonFailure: expected:<Parasolid> but was:<1>

I know why, in the HTML code the value of the paramenter is 1, but I don't know how to retrieve the name. Please have a look at the attachment.

Thank you,

Ana
Attachments:
 
HTML code
 

Answer : Setting parameters in a drop down list

You normally do not go to a particular row or column directly.
Normally, one would open and iterate through all the records in order until finished.
Please have a view of code in previous comment.

R("fieldname")
or
R(fieldindex)

gives you the column by field name or index (0-based)

R.movefirst, R.movenext moves the pointer to first or next in the recordset.
Random Solutions  
 
programming4us programming4us