Forum Discussion
Need more of your code to tell what you're doing here exactly but it seems to me you could possibly replace all of that code with just one line:
select.ClickItem(selectItem);
If this doesn't work, please post the entire ClickItem_ExactMatch function.
Thanks Ryan!
I had added a wrapper to the click item code to handle the case of the dropdown not being fully populated initially. In this particular instance, I can probably count on the dropdown always being fully populated.
I replaced my call to the function with your suggested direct call as follows:
myCards_addPayCard_cardType().ClickItem(cardType);
// ClickItem_ExactMatch(myCards_addPayCard_cardType(), cardType);
// if (myCards_addPayCard_cardType().Exists) {
// ClickItem_ExactMatch(myCards_addPayCard_cardType(), cardType);
// }
if (myCards_addPayCard_cardType().wText != cardType) {
Log.Error("ERROR: addPayCard_fields() correct card type was NOT selected");
return false;
}
I got the same error. In other words, no error indication or warning for the ClickItem, but yet the card type value in the dropdown did NOT change.
I had added a "context switch" where I go off and work in another browser to check the email was received properly for adding and removing the payment card. When I comment that code out the problem with the drop down does not occur. So apparently the "context switch" is causing a problem with the dropdown selection even though I can still determine that I am not on the selected value.....