testbench
testbench copied to clipboard
Allow to use getNoSuchElementMessage in ElementQuery
The ElementQuery
class contains a very nice method to create a meaningful "NoSuchElement"-Message for a NoSuchElementException
.
private String getNoSuchElementMessage(Integer index) {
String msg = "No element with tag <" + tagName + "> found";
String attrPairs = getAttributePairs();
if (!attrPairs.isEmpty()) {
msg += " with the attributes " + attrPairs;
}
if (index != null) {
msg += " using index " + index;
}
return msg;
}
I'd like to use this message in a custom NoSuchElementException
where this method would come in handy, but unfortunately it is declared private
.
Would it be possible to change the access modifier to public (final)
?