Project

General

Profile

Download (1.24 KB) Statistics
| Branch: | Tag: | Revision:
1
// $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.apache.log4j.Level;
13
import org.openqa.selenium.By;
14
import org.openqa.selenium.NoSuchElementException;
15
import org.openqa.selenium.WebElement;
16

    
17

    
18
/**
19
 * @author andreas
20
 * @date Jul 4, 2011
21
 *
22
 */
23
public class DrupalBlock extends BaseElement {
24

    
25
	private String header;
26

    
27
	protected WebElement content;
28

    
29
	/**
30
	 * @param element
31
	 */
32
	public DrupalBlock(WebElement element) {
33

    
34
		super(element);
35

    
36
		logger.setLevel(Level.TRACE);
37
        logger.trace("DrupalBlock() - constructor after super()");
38

    
39
		content = element.findElement(By.className("content"));
40

    
41
		logger.trace("DrupalBlock() - block content loaded");
42
		try {
43
			WebElement headerElement = element.findElement(By.tagName("h2"));
44
			header = headerElement.getText();
45
			logger.trace("DrupalBlock() - header text ready");
46
		} catch (NoSuchElementException e){
47
			// IGNORE //
48
		}
49
	}
50

    
51
	public String getHeader() {
52
		return header;
53
	}
54

    
55
	public WebElement getContent() {
56
		return content;
57
	}
58

    
59
}
(5-5/15)