| || |
FindAll method question
I have a page with a bunch of dropdown boxes with default values shown in the dropdown. If a user changes the defalult value to any other selection in the dropdown boxes and changes his/her mind, a clear all button can be pressed and returns the dropdowns to it's default state. My test is to make sure that clear all button returns all values to it's default state. I place all the default values (Strings) in array prior to the user doing anything and use these values to compare it against another array created by the FindAll method. From this array I can access the property wText with the values of the dropdown box. If the any element in the two arrays don't match, the dropdown boxes weren't cleared and the test fails. So basically I'm comparying one array with another. But I get an error "Object doesn't support this property or method" a this line in the code below: If strElementFirst = strElementSecond Then - How can I access the member properties of the Array object returned by the FindAll method?
Dim combotext:combotext = Array("All","All","All","All","--select a skin--","--select an operator","00","00","","00","00","","Today","All")
Set p = objPage
combobox = p.FindAll("wText","*")
For Each strElementFirst In combobox
existInSecond = False
For Each strElementSecond In combotext
If strElementFirst = strElementSecond Then
existInSecond = True
If Not existInSecond Then
Re: FindAll method question
Your code compares an object with a string which is not allowed. You need to use your combo boxes' properties, not the combo boxes themselves:
<font class="small">Code:</font><hr /><pre>...
If strElementFirst.wText = strElementSecond Then