Version
1.58.0(latest at time of reporting)
Steps to reproduce
This is a documentation issue and does not require a runtime reproduction.
- Open the Playwright Java documentation / API reference.
- Refer to examples or descriptions around Locator.allInnerTexts() and Locator.allTextContents().
- The return type may be interpreted as String[].
- In Playwright Java, the actual return type is List.
Expected behavior
Java documentation and examples should explicitly indicate that
Locator.allInnerTexts() and Locator.allTextContents() return List.
Java examples should avoid implying an array (String[]), which is the return
type in JavaScript/TypeScript, not Java.
Actual behavior
The documentation/examples can be interpreted as implying a String[] return type.
This leads Java users to write code such as:
String[] texts = locator.allInnerTexts();
which does not compile, since the actual return type is List.
Additional context
This confusion is common for Java users coming from TypeScript/JavaScript,
where the return type is string[].
Clarifying the Java-specific return type would improve onboarding and reduce
misuse.
Environment
Not applicable – documentation issue.
This report is about Java API documentation clarity and does not depend on runtime
environment or execution behavior.
Version
1.58.0(latest at time of reporting)
Steps to reproduce
This is a documentation issue and does not require a runtime reproduction.
Expected behavior
Java documentation and examples should explicitly indicate that
Locator.allInnerTexts() and Locator.allTextContents() return List.
Java examples should avoid implying an array (String[]), which is the return
type in JavaScript/TypeScript, not Java.
Actual behavior
The documentation/examples can be interpreted as implying a String[] return type.
This leads Java users to write code such as:
String[] texts = locator.allInnerTexts();
which does not compile, since the actual return type is List.
Additional context
This confusion is common for Java users coming from TypeScript/JavaScript,
where the return type is string[].
Clarifying the Java-specific return type would improve onboarding and reduce
misuse.
Environment