kakabubu
2 years agoContributor
ComboBox.ClickItem Asynchronous object call failed
I forced problems with one of my helper methods, which clicks the ComboBox item.
While debugging I assumed that problem was because ComboBox opens and closes (blinks) several times when I click an item.
Seems that it is caused by checking if cb.wItemList contains the required item before selecting it
So I've tried to remove that check, expecting something like "Item not found" error. Instead of it, I got "Asynchronous object call failed" error.
I've tried to cover it on "try {} catch () {}" as it shown below:
try {// ts-ignore
let callResult = Runner.CallObjectMethodAsync(list, 'ClickItem', itemText);
while (!callResult.Completed) {
if (!counter.check(dontLogError)) break;
isSelected = waitSelected ? waitItemSelected(100) : callResult.Completed;
if (isSelected) break;
}
}
catch (e) {
Log.Error('Error selecting "' + itemText + '": "' + e + '"\nAvailable items list: ' + list.wItemList);
return false;
}
return true;
but catching the error failed.
CallStack points me inside of waitSelectedItem(100), which is actually just
const waitItemSelected = (timeout = 0) => list.WaitProperty('Text', itemText, timeout);
Tried covering this method in "try {} catch () {}" didn't work