Revision bcc70074
Added by Andreas Kohlbecker over 3 years ago
src/main/java/eu/etaxonomy/dataportal/ElementUtils.java | ||
---|---|---|
11 | 11 |
import java.util.ArrayList; |
12 | 12 |
import java.util.List; |
13 | 13 |
|
14 |
import org.apache.commons.lang3.StringUtils; |
|
14 | 15 |
import org.apache.log4j.Logger; |
15 | 16 |
import org.openqa.selenium.By; |
16 | 17 |
import org.openqa.selenium.WebElement; |
... | ... | |
117 | 118 |
return ElementUtils.baseElementsFromFootNoteListElements(fnListElements); |
118 | 119 |
} |
119 | 120 |
|
121 |
/** |
|
122 |
* Intended for loggin purposes. |
|
123 |
* <p> |
|
124 |
* Creates incomplete markup of the WebElement with the attributes id and class like: |
|
125 |
* {@code <tagName id="the-id" class=""> |
|
126 |
* |
|
127 |
* @param we the WebElement |
|
128 |
* @return the markup |
|
129 |
*/ |
|
130 |
public static String webElementTagToMarkup(WebElement we) { |
|
131 |
String markup = "<" + we.getTagName(); |
|
132 |
String idAttr = we.getAttribute("id"); |
|
133 |
String classAttr = we.getAttribute("class"); |
|
134 |
if(StringUtils.isNotEmpty(idAttr)) { |
|
135 |
markup += " id=\""+ classAttr + "\""; |
|
136 |
} |
|
137 |
if(StringUtils.isNotEmpty(classAttr)) { |
|
138 |
markup += " class=\""+ classAttr + "\""; |
|
139 |
} |
|
140 |
markup += " >"; |
|
141 |
return markup; |
|
142 |
} |
|
143 |
|
|
120 | 144 |
|
121 | 145 |
} |
Also available in: Unified diff
fix #9186 test for speciment detrivate path view & DescriptionList web element wrapper