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

$.selectOptionByValue() reports a misleading error message #709

Closed
asolntsev opened this Issue Mar 31, 2018 · 4 comments

Comments

Projects
None yet
3 participants
@asolntsev
Copy link
Contributor

asolntsev commented Mar 31, 2018

Steps to reproduce:

  1. Given a page with <select> and options val1 and val2.
  2. Call method $("select").selectOptionByValue("val3");.
  3. Selenide shows a misleading error message:
Element not found {By.cssSelector: select}
Expected: exist
Caused by: NoSuchElementException: Cannot locate option with value: val3

Expected result: Selenide should show a correct error message like "Option with value 'val3' is not found".

environment

  • Selenide Version: 4.10.01
@BorisOsipov

This comment has been minimized.

Copy link
Member

BorisOsipov commented Mar 31, 2018

@asolntsev are you sure expected results can be fulfilled? as I know it is hard to implement(

@asolntsev

This comment has been minimized.

Copy link
Contributor

asolntsev commented Mar 31, 2018

@BorisOsipov I don't know yet, I haven't researched it yet.

@rosolko

This comment has been minimized.

Copy link
Collaborator

rosolko commented Apr 1, 2018

@asolntsev @BorisOsipov with little tuning of selectOptionByValue method we can get error like:

Element not found {among values: [@livemail.ru, @myrambler.ru, @rusmail.ru, @мыло.ру]}
Expected: value 'myrambler.ru1'

Seems like all tests passed after that tuning.
Or even generate error as for SelectOptionByTextOrIndex:

Element not found {By.xpath: //select[@name='domain']/option[@value='myrambler.ru1']}
Expected: exist

Or just:

Element not found {By.xpath: //option[@value='myrambler.ru1']}
Expected: exist
@asolntsev

This comment has been minimized.

Copy link
Contributor

asolntsev commented Aug 17, 2018

Fixed in #780, will be released in Selenide 4.12.4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment