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

public class TextOfAll extends Object implements net.serenitybdd.screenplay.Question<List<String>>
Get the text content of all matching elements.

Sample usage:

     List<String> texts = actor.asksFor(TextOfAll.of(".list-item"));
     List<String> texts = actor.asksFor(TextOfAll.of(LIST_ITEMS));
 
  • Method Summary

    Modifier and Type
    Method
    Description
    answeredBy(net.serenitybdd.screenplay.Actor actor)
     
    static TextOfAll
    of(String selector)
    Get text of all elements matching a selector.
    static TextOfAll
    of(Target target)
    Get text of all elements matching a Target.
     

    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 TextOfAll of(String selector)
      Get text of all elements matching a selector.
    • of

      public static TextOfAll of(Target target)
      Get text of all elements matching a Target.
    • 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