summaryrefslogtreecommitdiffstats
path: root/uitest/src/com/vaadin/testbench/elements/GridElement.java
diff options
context:
space:
mode:
Diffstat (limited to 'uitest/src/com/vaadin/testbench/elements/GridElement.java')
-rw-r--r--uitest/src/com/vaadin/testbench/elements/GridElement.java16
1 files changed, 16 insertions, 0 deletions
diff --git a/uitest/src/com/vaadin/testbench/elements/GridElement.java b/uitest/src/com/vaadin/testbench/elements/GridElement.java
index 5d85de4eb6..e04140a3e0 100644
--- a/uitest/src/com/vaadin/testbench/elements/GridElement.java
+++ b/uitest/src/com/vaadin/testbench/elements/GridElement.java
@@ -129,6 +129,22 @@ public class GridElement extends AbstractComponentElement {
public void cancel() {
findElement(By.className("v-grid-editor-cancel")).click();
}
+
+ /**
+ * Gets the error message text, or <code>null</code> if no message is
+ * present.
+ */
+ public String getErrorMessage() {
+ WebElement messageWrapper = findElement(By
+ .className("v-grid-editor-message"));
+ List<WebElement> divs = messageWrapper.findElements(By
+ .tagName("div"));
+ if (divs.isEmpty()) {
+ return null;
+ } else {
+ return divs.get(0).getText();
+ }
+ }
}
/**