java.lang.Object
net.serenitybdd.screenplay.playwright.questions.AllOptionTexts
All Implemented Interfaces:
net.serenitybdd.screenplay.Question<List<String>>

public class AllOptionTexts extends Object implements net.serenitybdd.screenplay.Question<List<String>>
Get the text of all options in a select element.

Sample usage:

     List<String> options = actor.asksFor(AllOptionTexts.of("#country"));
     List<String> options = actor.asksFor(AllOptionTexts.of(COUNTRY_DROPDOWN));
 
  • Method Summary

    Modifier and Type
    Method
    Description
    answeredBy(net.serenitybdd.screenplay.Actor actor)
     
    of(String selector)
    Get all option texts from a select element identified by a selector.
    of(Target target)
    Get all option texts from a Target select element.
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait

    Methods inherited from interface net.serenitybdd.screenplay.Question

    as, asADate, asADate, asBigDecimal, asBoolean, asCollectionOf, asDouble, asEnum, asFloat, asInteger, asListOf, asLong, asString, describedAs, getSubject, map, mapEach
  • Method Details

    • of

      public static AllOptionTexts of(String selector)
      Get all option texts from a select element identified by a selector.
    • of

      public static AllOptionTexts of(Target target)
      Get all option texts from a Target select element.
    • answeredBy

      public List<String> answeredBy(net.serenitybdd.screenplay.Actor actor)
      Specified by:
      answeredBy in interface net.serenitybdd.screenplay.Question<List<String>>
    • toString

      public String toString()
      Overrides:
      toString in class Object