Skip to content

Commit

Permalink
#202 return correct text for inputs with a type other than "text"
Browse files Browse the repository at this point in the history
  • Loading branch information
Va1tra committed May 29, 2019
1 parent 94489ac commit 83fe0b5
Showing 1 changed file with 3 additions and 5 deletions.
8 changes: 3 additions & 5 deletions src/main/java/com/wiley/elements/types/BaseTeasyElement.java
Expand Up @@ -283,7 +283,7 @@ public boolean isStale() {
public String getText() {
try {
String text;
if (isInputTextField()) {
if (isInputField()) {
text = wrappedElement.getText().isEmpty() ? wrappedElement.getAttribute("value") : wrappedElement.getText();
} else {
text = wrappedElement.getText();
Expand All @@ -295,10 +295,8 @@ public String getText() {
}
}

private boolean isInputTextField() {
return wrappedElement.getTagName().equals("input")
&& wrappedElement.getAttribute("type") != null
&& wrappedElement.getAttribute("type").equals("text");
private boolean isInputField() {
return wrappedElement.getTagName().equals("input");
}

public WebElement findElement(By by) {
Expand Down

0 comments on commit 83fe0b5

Please sign in to comment.