Multiple select #400

Closed
kenshir007 opened this Issue Sep 19, 2016 · 3 comments

Projects

None yet

2 participants

@kenshir007
kenshir007 commented Sep 19, 2016 edited

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
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);
@kenshir007

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 asolntsev added a commit that referenced this issue Sep 24, 2016
@asolntsev asolntsev #400 fix checkstyle issues 0c6ac2d
@asolntsev
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

@asolntsev asolntsev closed this Sep 24, 2016
@BorisOsipov BorisOsipov added a commit to BorisOsipov/selenide that referenced this issue Nov 23, 2016
@asolntsev @BorisOsipov asolntsev + BorisOsipov #400 add method $("select").getSelectedOptions() for retrieving ALL s…
…elected options
0cabf2d
@BorisOsipov BorisOsipov added a commit to BorisOsipov/selenide that referenced this issue Nov 23, 2016
@asolntsev @BorisOsipov asolntsev + BorisOsipov #400 methods $.selectOption, $.selectOptionByValue now accept multipl…
…e arguments
692b794
@BorisOsipov BorisOsipov added a commit to BorisOsipov/selenide that referenced this issue Nov 23, 2016
@asolntsev @BorisOsipov asolntsev + BorisOsipov #400 fix checkstyle issues dced155
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment