1 |
50607782
|
Andreas Kohlbecker
|
// $Id$
|
2 |
|
|
/**
|
3 |
|
|
* Copyright (C) 2011 EDIT
|
4 |
|
|
* European Distributed Institute of Taxonomy
|
5 |
|
|
* http://www.e-taxonomy.eu
|
6 |
|
|
*
|
7 |
|
|
* The contents of this file are subject to the Mozilla Public License Version 1.1
|
8 |
|
|
* See LICENSE.TXT at the top of this package for the full license terms.
|
9 |
|
|
*/
|
10 |
|
|
package eu.etaxonomy.dataportal.elements;
|
11 |
|
|
|
12 |
|
|
import org.openqa.selenium.By;
|
13 |
|
|
import org.openqa.selenium.NoSuchElementException;
|
14 |
|
|
import org.openqa.selenium.WebElement;
|
15 |
|
|
|
16 |
|
|
|
17 |
|
|
/**
|
18 |
|
|
* @author andreas
|
19 |
|
|
* @date Jul 4, 2011
|
20 |
|
|
*
|
21 |
|
|
*/
|
22 |
|
|
public class DrupalBlock extends BaseElement {
|
23 |
|
|
|
24 |
|
|
private String header;
|
25 |
|
|
|
26 |
535407a1
|
Andreas Kohlbecker
|
protected WebElement content;
|
27 |
50607782
|
Andreas Kohlbecker
|
|
28 |
|
|
/**
|
29 |
|
|
* @param element
|
30 |
|
|
*/
|
31 |
535407a1
|
Andreas Kohlbecker
|
public DrupalBlock(WebElement element) {
|
32 |
50607782
|
Andreas Kohlbecker
|
|
33 |
|
|
super(element);
|
34 |
|
|
|
35 |
535407a1
|
Andreas Kohlbecker
|
content = element.findElement(By.className("content"));
|
36 |
50607782
|
Andreas Kohlbecker
|
|
37 |
|
|
try {
|
38 |
|
|
WebElement headerElement = element.findElement(By.tagName("h2"));
|
39 |
|
|
header = headerElement.getText();
|
40 |
|
|
} catch (NoSuchElementException e){
|
41 |
|
|
// IGNORE //
|
42 |
|
|
}
|
43 |
|
|
}
|
44 |
|
|
|
45 |
|
|
public String getHeader() {
|
46 |
|
|
return header;
|
47 |
|
|
}
|
48 |
|
|
|
49 |
535407a1
|
Andreas Kohlbecker
|
public WebElement getContent() {
|
50 |
50607782
|
Andreas Kohlbecker
|
return content;
|
51 |
|
|
}
|
52 |
|
|
|
53 |
|
|
}
|