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

Multiple select #400

Closed
andrey-ryoo opened this Issue Sep 19, 2016 · 3 comments

Comments

Projects
None yet
2 participants
@andrey-ryoo

andrey-ryoo commented Sep 19, 2016

I think it would be great idea to add selectMultiple(String...) to SelenideElement interface.
It should select all options listed in arguments.
example of usage:
$(String).selectOption("Option 1", "Option 2);

@asolntsev

This comment has been minimized.

Show comment
Hide comment
@asolntsev

asolntsev Sep 19, 2016

Member

@kenshir007 Sure, why not. Do you mean "select by text" or "select by value"?

Probably it would be better to just add varargs to existing methods selectOption and selectOptionByValue? It would mean that you can write simply

  $("select").selectOptionByValue("aa", "bb", "cc");
  $("select").selectOption("Aaa", "Bbb", "Ccc);
Member

asolntsev commented Sep 19, 2016

@kenshir007 Sure, why not. Do you mean "select by text" or "select by value"?

Probably it would be better to just add varargs to existing methods selectOption and selectOptionByValue? It would mean that you can write simply

  $("select").selectOptionByValue("aa", "bb", "cc");
  $("select").selectOption("Aaa", "Bbb", "Ccc);
@andrey-ryoo

This comment has been minimized.

Show comment
Hide comment
@andrey-ryoo

andrey-ryoo Sep 20, 2016

Cool, I meant both, text and options, cause both of them may be required

Cool, I meant both, text and options, cause both of them may be required

@asolntsev asolntsev added this to the 3.10 milestone Sep 24, 2016

asolntsev added a commit that referenced this issue Sep 24, 2016

asolntsev added a commit that referenced this issue Sep 24, 2016

@asolntsev

This comment has been minimized.

Show comment
Hide comment
@asolntsev

asolntsev Sep 24, 2016

Member

I have add new method for retrieving all selected options:

select.getSelectedOptions().shouldHave(
        texts("Маргарита", "Theodor Woland"));

And these 3 methods now accept multiple arguments:

select.selectOption("Маргарита", "Theodor Woland");
select.selectOption(0, 2, 3);
select.selectOptionByValue("cat", "woland");

See https://github.com/codeborne/selenide/blob/master/src/test/java/integration/MultipleSelectTest.java

Member

asolntsev commented Sep 24, 2016

I have add new method for retrieving all selected options:

select.getSelectedOptions().shouldHave(
        texts("Маргарита", "Theodor Woland"));

And these 3 methods now accept multiple arguments:

select.selectOption("Маргарита", "Theodor Woland");
select.selectOption(0, 2, 3);
select.selectOptionByValue("cat", "woland");

See https://github.com/codeborne/selenide/blob/master/src/test/java/integration/MultipleSelectTest.java

@asolntsev asolntsev closed this Sep 24, 2016

BorisOsipov added a commit to BorisOsipov/selenide that referenced this issue Nov 23, 2016

BorisOsipov added a commit to BorisOsipov/selenide that referenced this issue Nov 23, 2016

BorisOsipov added a commit to BorisOsipov/selenide that referenced this issue Nov 23, 2016

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