11-28-2014, 09:41 PM
I've got a drop down box on my screen that contains a list of values and am trying to select one but it's not finding a match because of trailing spaces.
i.e. the list contains values such as:
The input data I have does not contain trailing spaces so when I try to select it from the drop down it's telling me it can't be found.
If it was the other way round and it was the input that had the trailing spaces i'd simply trim it first but some of these drop down lists in my application can contain hundreds of values and we have thousands of these drop down boxes on our system so don't want to have to code for each one manually!
My solution is to try and find the maximum length of the combo box and add those spaces into my test data. So if I know the combo box is always 20 characters long and my input data is 5 characters I can just write a global function to pad out the remaining spaces.
I've looked in object spy and can find out how many items there are in the list using the item count but can't see anything that tells me the length of the combo box.
i.e. the list contains values such as:
Code:
Mr "
"Mrs "
"Sir "
The input data I have does not contain trailing spaces so when I try to select it from the drop down it's telling me it can't be found.
If it was the other way round and it was the input that had the trailing spaces i'd simply trim it first but some of these drop down lists in my application can contain hundreds of values and we have thousands of these drop down boxes on our system so don't want to have to code for each one manually!
My solution is to try and find the maximum length of the combo box and add those spaces into my test data. So if I know the combo box is always 20 characters long and my input data is 5 characters I can just write a global function to pad out the remaining spaces.
I've looked in object spy and can find out how many items there are in the list using the item count but can't see anything that tells me the length of the combo box.