Skip to content

Commit 6d99a25

Browse files
glibasbarancev
authored andcommitted
[Java] Add toString() to DefaultElementLocator
Add toString() method to DefaultElementLocator and child classes in oder to display descriptive message instead of object's class name and hash code when TimeoutException is thrown while using PageFactory. Signed-off-by: Alexei Barantsev <barancev@gmail.com>
1 parent 8574144 commit 6d99a25

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

java/client/src/org/openqa/selenium/support/pagefactory/DefaultElementLocator.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,4 +89,9 @@ public List<WebElement> findElements() {
8989

9090
return elements;
9191
}
92+
93+
@Override
94+
public String toString(){
95+
return this.getClass().getSimpleName() + " '" + by + "'";
96+
}
9297
}

0 commit comments

Comments
 (0)