-
Notifications
You must be signed in to change notification settings - Fork 783
raise exception in (un)select from list... #92
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
when nothing match
the issue is that when you "select from list" with an non-existing item name, no error will be returned |
Looks good to me. Any objections to me merging? |
With the performance changes to "Select Element From List ..." code this patch will not merge in. I've written a quick test and this issue is still present with the generic keyword 'Select From List'. (The more specific and speedier 'Select From List By Value', '...By Label', and '...By Index' all catch this error and throw a exception). I have a new patch which resolves this issue but I have a question on expected functionality. Since 'Select From List'...
should we
Anyone with suggestions as to the best behaviour should be? * only empty list? what if it is None? Note to self to check this |
I would suggest to go with the first simple option, thanks! Adam From: Ed Manlove With the performance changes to "Select Element From List ..." code this patch will not merge in. I've written a quick test and this issue is still present with the generic keyword 'Select From List'. (The more specific and speedier 'Select From List By Value', '...By Label', and '...By Index' all catch this error and throw a exception). I have a new patch which resolves this issue but I have a question on expected functionality. Since 'Select From List'... a.. handles both multi-selection lists and single-selection lists and... 1.. Throw a generic "Item not within list" exception if any item is not present (by value or label) ...or...
— |
@adwu73 submitted a pull request, robotframework#92, with changes to perform this check but we had delayed pulling it and in the meantime other chnages were made. I am resubmitting similar changes working out the best way to catch and report the error.
@adwu73 I've added some code and a test to give some sandbox room to try the methods. Here is some sample code to test it my changes above
|
I'm getting the feeling that Selenium does not throw an exception when one tries to unselect an non-existing item. Need to verify this when I find some more time. |
when nothing match