From 6e37166d706ce23cc3e521ea3d7ed3ec0f09cd64 Mon Sep 17 00:00:00 2001 From: Dennis Aulenbacher Date: Fri, 28 Aug 2020 13:10:21 +0200 Subject: [PATCH] Extended TextBoxBasePO by getValue() method --- .../pages/gwt/StringListEditorCompositePO.java | 2 +- .../sap/sailing/selenium/pages/gwt/TextBoxBasePO.java | 10 ++++++++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/gwt/StringListEditorCompositePO.java b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/gwt/StringListEditorCompositePO.java index f590d283afe..4f9cf32caf5 100644 --- a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/gwt/StringListEditorCompositePO.java +++ b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/gwt/StringListEditorCompositePO.java @@ -27,7 +27,7 @@ public class StringListEditorCompositePO extends PageArea { public String getValueEntryName(){ TextBoxPO textBoxPO = new TextBoxPO(this.driver, valueTextBox); - String text = textBoxPO.getWebElement().getAttribute("value"); + String text = textBoxPO.getValue(); return text; } } diff --git a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/gwt/TextBoxBasePO.java b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/gwt/TextBoxBasePO.java index 5a27fdd479d..2e39e688350 100644 --- a/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/gwt/TextBoxBasePO.java +++ b/java/com.sap.sailing.selenium.test/src/com/sap/sailing/selenium/pages/gwt/TextBoxBasePO.java @@ -53,5 +53,15 @@ public abstract class TextBoxBasePO extends AbstractInputPO { public String getText() { return getWebElement().getText(); } + + /** + * Gets the text contained in the underlying {@link WebElement}s "Value" attribute. + * This might be necessary for input elements that do not maintain their contained text in the "innerText" attribute, that is returned by #WebElement#getText() + * @return the contained text + * + */ + public String getValue() { + return getWebElement().getAttribute("Value"); + } }