GAutomation
6 years agoFrequent Contributor
how to compare the items in the witemlist and the values passed in excel sgould be equal.
we are running a regression with keyword driven framewrok and wanted to write a vb script code to compare list of values in the combobox that are passed in the excel is matching the witemlist.
trim(uCASe(obj.witemlist)) = trim(ucase(value))
when i debug i see all the values are matching but only issue is the values passed in excel are showing continuously like x y z. even the value the cell column in excel
x
y
z
how to handle this?
Actually, you know what, I'd do it in a series of checks...
So, it's a dropdown/combo box. I'm guessing Windows Desktop application. So, first comparison is to compare the lengths. If they don't match, don't bother. Then, once we know the lenghts match, we just go down the line, item by item.var excelList = 'x y z'; aqString.ListSeparator = ' '; if (Aliases.MyApp.MyForm.MyComboBox.wItemCount) != aqString.GetListLength(excelList)) { Log.Error('The list lengths don't match'); } else { for (var i=0; i < aqString.GetListLength(excelList);i++){ if (Aliases.MyApp.MyForm.MyComboBox.wItem(i) != GetListItem(excelList(i))){ Log.Error('List item ' + i + ' does not match'); } } }