Author: ozizka(a)redhat.com
Date: 2009-05-06 18:29:07 -0400 (Wed, 06 May 2009)
New Revision: 393
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
EJTT: More HtmlElementNotFoundEx's now dump the page to target/ .
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
===================================================================
---
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-05-06
21:37:44 UTC (rev 392)
+++
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-05-06
22:29:07 UTC (rev 393)
@@ -152,7 +152,7 @@
private void clickRootNode() throws IOException, EmbJoprTestException {
DomElement element = (DomElement)client.getElement(ID_NAV_TREE_FORM);
if( null == element )
- throw new HtmlElementNotFoundException("Can't find
#"+ID_NAV_TREE_FORM+".");
+ throw new HtmlElementNotFoundException("Can't find
#"+ID_NAV_TREE_FORM+".", currentTest);
// ID changes upon core build?
//HtmlAnchor rootNodeLink =
element.getFirstByXPath(".//a[@id='navTreeForm:navTree:2::homeLink']");
@@ -167,7 +167,7 @@
HtmlAnchor rootNodeLink = element.getFirstByXPath(xPath);
if( null == rootNodeLink )
- throw new HtmlElementNotFoundException("Root node not found using XPath:
"+xPath);
+ throw new HtmlElementNotFoundException("Root node not found using XPath:
"+xPath, currentTest);
rootNodeLink.click();
}
@@ -449,7 +449,7 @@
if( null == tabContent )
- throw new HtmlElementNotFoundException("Tab '"+label+"' not
found using XPath '"+xPath+"'");
+ throw new HtmlElementNotFoundException("Tab '"+label+"' not
found using XPath '"+xPath+"'", currentTest);
return tabContent;
}
@@ -458,7 +458,7 @@
{
ClickableElement element = (ClickableElement)client.getElement(tabID);
if( null == element )
- throw new HtmlElementNotFoundException("Tab with id
'"+tabID+"' not found, perhaps disabled?");
+ throw new HtmlElementNotFoundException("Tab with id
'"+tabID+"' not found, perhaps disabled?", currentTest);
return element;
}
@@ -620,7 +620,7 @@
HtmlTable tableElement = (HtmlTable) element.getFirstByXPath(xPath);
if( null == tableElement ){
throw new HtmlElementNotFoundException(
- "Table under header '"+headerText+"' not found using
XPath: "+xPath);
+ "Table under header '"+headerText+"' not found using
XPath: "+xPath, currentTest);
}
return new ContentTable(tableElement);
@@ -669,7 +669,7 @@
if( null == elem )
throw new HtmlElementNotFoundException(
"Can't find the content table element, searched IDs: "
- + StringUtils.join(elemIDs, ", ") );
+ + StringUtils.join(elemIDs, ", "), currentTest );
return new ContentTable( (HtmlTable)elem );
@@ -861,7 +861,7 @@
String xPath = ".//tr[.//*[contains(string(),
'"+text+"')]]";
HtmlTableRow elm = (HtmlTableRow) element.getFirstByXPath(xPath);
if( null == elm )
- throw new HtmlElementNotFoundException(xPath);
+ throw new HtmlElementNotFoundException(xPath, currentTest);
return new ContentTableRow(elm, this);
}
Show replies by date