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

public class AttributeOfAll extends Object implements net.serenitybdd.screenplay.Question<List<String>>
Get an attribute value from all matching elements.

Sample usage:

     List<String> hrefs = actor.asksFor(AttributeOfAll.of("a").named("href"));
     List<String> ids = actor.asksFor(AttributeOfAll.of(LINKS).named("id"));
 
  • Method Details

    • of

      public static AttributeOfAll of(String selector)
      Get attribute values from elements matching a selector.
    • of

      public static AttributeOfAll of(Target target)
      Get attribute values from elements matching a Target.
    • named

      public AttributeOfAll named(String attributeName)
      Specify the attribute name to retrieve.
    • 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