Author: ozizka(a)redhat.com
Date: 2009-04-07 12:50:10 -0400 (Tue, 07 Apr 2009)
New Revision: 278
Added:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/tc/
Modified:
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/WarTest.java
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java
Log:
WAR tests updated, EJTT updated
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java 2009-04-06
21:23:13 UTC (rev 277)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/AppConstants.java 2009-04-07
16:50:10 UTC (rev 278)
@@ -41,11 +41,12 @@
// Mandatory: first, fourth
// Nav tree link label, testdata/$dir, extension, suffix, mime type.
- EAR(AppConstants.NAV_EAR, "ear", ".ear", null,
"application/ear"),
- WAR(AppConstants.NAV_WAR, "war", ".war", null,
"application/war"),
- EJB(AppConstants.NAV_EJB, "ejb", ".jar", null,
" application/java-archive"),
- SAR(AppConstants.NAV_SAR, "sar", ".sar",
"-service.xml", "application/sar"),
- RAR(AppConstants.NAV_RAR, "rar", ".rar", null,
"application/rar"),
+ EAR(AppConstants.NAV_EAR, "ear", ".ear", null,
"application/ear"),
+ WAR(AppConstants.NAV_WAR, "war", ".war", null,
"application/war"),
+ EJB2(AppConstants.NAV_EJB2, "ejb2", ".jar", null,
" application/java-archive"),
+ EJB3(AppConstants.NAV_EJB3, "ejb3", ".jar", null,
" application/java-archive"),
+ SAR(AppConstants.NAV_SAR, "sar", ".sar",
"-service.xml", "application/sar"),
+ RAR(AppConstants.NAV_RAR, "rar", ".rar", null,
"application/rar"),
MC_BEAN(AppConstants.NAV_MC, "mc", "", null,
"application/java-archive");
// -- Fields --
@@ -99,7 +100,9 @@
// Navigation
public static final String NAV_APPLICATIONS = "Applications";
- public static final String NAV_EJB = "EJB Application (EJB JAR)s";
+ //public static final String NAV_EJB = "EJB Application (EJB JAR)s";
+ public static final String NAV_EJB2 = "EJB 2.x Application (EJB JAR)s";
+ public static final String NAV_EJB3 = "EJB 3.x Application (EJB JAR)s";
public static final String NAV_EAR = "Enterprise Application (EAR)s";
public static final String NAV_SAR = "JBoss Service (SAR)s";
public static final String NAV_MC = "Microconainer Beans (MC_Bean)s";
@@ -111,13 +114,20 @@
public static final String WAR_FILENAME_MALFORMED_APP =
"malformed-web-xml.war";
// Test Archives
+
+ // EJB 3.0
public static final String BASIC_JAR = "deployment-ejb.jar";
+ public static final String BASIC_EJB3 = "basic-ejb3.jar";
+
+
+ // EAR
public static final String BASIC_EAR = "eardeployment.ear";
public static final String EAR_UNPACKED = "unpacked-ear1.ear";
public static final String EAR_UNPACKED_ZIP = "unpacked-ear1.ear.zip";
public static final String EAR_WITH_WAR = "EarWithWarNB.ear";
public static final String EAR_WITH_WAR_COUNTER = "EarWithWar-Counter.ear";
+ // WAR
public static final String BASIC_WAR = "hellothere.war";
public static final String BASIC_WAR_02 = "hellothere02.war";
public static final String BASIC_WAR_03 = "hellothere03.war";
@@ -136,6 +146,10 @@
public static final String WAR_UNPACKED_ZIP = "unpacked-web1.war.zip";
+
+
+
+
// Defaults
public static final String[] WAR_DEFAULTS = new String[]{
"ROOT.war", "invoker.war",
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java
===================================================================
---
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java 2009-04-06
21:23:13 UTC (rev 277)
+++
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/ApplicationTestBaseAS5.java 2009-04-07
16:50:10 UTC (rev 278)
@@ -155,23 +155,6 @@
}
-
-
-
-
-
-
-
-
-
- /* ---- Copied from ServerNodeSummaryTest.java, before moving to EmbjoprTestCase.java
--- */
-
-
-
-
-
-
-
}// ApplicationTestBaseAS5
Property changes on: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5
___________________________________________________________________
Name: svn:ignore
- JMXUtilsAS5.java
+ Ejb30Test.java
JMXUtilsAS5.java
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java 2009-04-06
21:23:13 UTC (rev 277)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/EarTest.java 2009-04-07
16:50:10 UTC (rev 278)
@@ -299,7 +299,7 @@
*/
public void testEarSummaryTab() throws EmbJoprTestException, IOException, Exception {
- final int DEPLOY_TIMEOUT_SEC = 10;
+ final int DEPLOY_TIMEOUT_SEC = 20;
// Deploy the EAR
String earFilePath = System.getProperty(SYSPROP_TESTDATA_DIR) +
"/ear/"+BASIC_EAR;
@@ -489,6 +489,8 @@
/**
* Redeploys EAR.
+ *
+ * Fails because of EMBJOPR-109 - HTTP Status 500 - Error in Seam/JSF
*/
public void testEarRedeployment() throws IOException, EmbJoprTestException {
@@ -517,7 +519,11 @@
}
finally {
- undeployEar(BASIC_EAR);
+ try {
+ undeployEar(BASIC_EAR); // EMBJOPR-109 here.
+ }catch( Exception ex ){
+ log.error("Caught exception when undeploying: "+ex, ex);
+ }
}
}
@@ -547,7 +553,11 @@
}
finally {
- undeployEar(BASIC_EAR);
+ try {
+ undeployEar(BASIC_EAR);
+ }catch( Exception ex ){
+ log.error("Caught exception when undeploying: "+ex, ex);
+ }
}
}
@@ -581,14 +591,18 @@
getTableUnderHeader("Trait Values").getElement();
ContentInfoTable infoTable = ejtt.getContentInfoTable( tbl );
Properties props = infoTable.getProperties();
+ log.debug("EAR Metrics tab - Trait Values: "+ props.toString());
String path = ejtt.getDeployDir()+"/"+BASIC_EAR;
- assertEquals(path, props.getProperty("Path").trim());
+ assertEquals(path, props.getProperty("Path"));
-
}
finally {
- undeployEar(BASIC_EAR);
+ try {
+ undeployEar(BASIC_EAR);
+ }catch( Exception ex ){
+ log.error("Caught exception when undeploying: "+ex, ex);
+ }
}
}
@@ -626,7 +640,11 @@
}
finally {
- undeployEar(BASIC_EAR);
+ try {
+ undeployEar(BASIC_EAR);
+ }catch( Exception ex ){
+ log.error("Caught exception when undeploying: "+ex, ex);
+ }
}
}
@@ -711,6 +729,7 @@
}
finally {
+ DebugUtils.writeFile("target/testEarWithWar-beforeUndeployment.html",
client.getPageAsText() );///
undeployEar(BASIC_EAR);
}
@@ -759,8 +778,8 @@
assertTrue("Page should contain 'HELLO WORLD'",
page.asText().contains("HELLO WORLD"));
// Refresh the page several times to increase the counter.
- page.refresh();
- page.refresh();
+ page = (HtmlPage) page.refresh();
+ page = (HtmlPage) page.refresh();
// Get the counter number.
Integer count1 =
NumberUtils.createInteger(page.getBody().getHtmlElementById("count").getTextContent());
@@ -781,7 +800,8 @@
HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tr[contains(@class,
'rich-table-firstrow')]");
assertTrue( tr.getTextContent().contains("Success") );
/**/
- assertTrue(
ejtt.getTabMenu().getTabContentBox().getOperationHistoryTable().wasLastOperationSuccesful()
);
+ DebugUtils.writeFile("target/testStopAndStartEar-opsTable.html",
client.getPageAsText() );///
+ assertTrue(
ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful()
);
// Assert that the app is stopped.
@@ -793,7 +813,7 @@
ejtt.tabMenu.getTabContentBox().getButtonByLabel("Start").click();
// Check the latest message. TODO: EJTT class for ops history table?
- HtmlTable operationHistoryTable =
ejtt.getTabMenu().getTabContentBox().getOperationHistoryTable().getElement();
+ HtmlTable operationHistoryTable =
ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().getElement();
HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tr[contains(@class,
'rich-table-firstrow')]");
assertTrue( tr.getTextContent().contains("Success") );
@@ -852,8 +872,8 @@
assertTrue("Page should contain 'HELLO WORLD'",
page.asText().contains("HELLO WORLD"));
// Refresh the page several times to increase the counter.
- page.refresh();
- page.refresh();
+ page = (HtmlPage) page.refresh();
+ page = (HtmlPage) page.refresh();
// Get the counter number.
Integer count1 =
NumberUtils.createInteger(page.getBody().getHtmlElementById("count").getTextContent());
@@ -869,7 +889,7 @@
ejtt.tabMenu.getTabContentBox().getButtonByLabel("Restart").click();
// Check the latest message. TODO: EJTT class for ops history table?
- HtmlTable operationHistoryTable =
ejtt.getTabMenu().getTabContentBox().getOperationHistoryTable().getElement();
+ HtmlTable operationHistoryTable =
ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().getElement();
HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tr[contains(@class,
'rich-table-firstrow')]");
assertTrue( tr.getTextContent().contains("Success") );
@@ -1087,7 +1107,9 @@
File dirToDelete = new File( deployDir, deployableName);
// Just not to delete something accidentally...
- assertTrue( deployDir.contains("/server/"));
+ // Not true for Cargo maven plugin.
+ //assertTrue( deployDir+" contains '/server/'",
deployDir.contains("/server/"));
+
// Check if not outside deploy dir.
if( !dirToDelete.getCanonicalPath().startsWith( deployDir ) )
throw new IllegalArgumentException(
Modified: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/WarTest.java
===================================================================
--- trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/WarTest.java 2009-04-06
21:23:13 UTC (rev 277)
+++ trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/as5/WarTest.java 2009-04-07
16:50:10 UTC (rev 278)
@@ -73,7 +73,7 @@
* deployed. Undeploy the archive.
*
*/
- public void testBasicWarDeployment()
+ public void testBasicWarDeployment()
throws IOException, HtmlElementNotFoundException, ActionNotAvailableException
{
@@ -121,9 +121,12 @@
+ /**
+ * Tries to deploy a invalid WAR (with invalid descriptor)
+ * and checks that EmbJopr rejects this deployment.
+ */
+ public void testBadWarRedeploy() throws IOException, EmbJoprTestException {
- public void testBadWarRedeploy() throws IOException, HtmlElementNotFoundException,
ActionNotAvailableException {
-
final String DEPLOYABLE_NAME = AppConstants.WAR_FILENAME_MALFORMED_APP;
try {
@@ -286,7 +289,7 @@
/**
* Tests the values shown in the Summary tab of WAR.
*
- * FAILS because of: EMBJOPR-110
+ * FAILS because of: EMBJOPR-110 (missing / at the beginning of the path)
*/
public void testWarSummaryTab() throws EmbJoprTestException, IOException, Exception {
@@ -671,6 +674,8 @@
/**
* Checks WAR metrics tab.
+ *
+ * FAILS because of: EMBJOPR-110 (missing / at the beginning of the path)
*/
public void testWarMetricsTab() throws IOException, EmbJoprTestException {
@@ -823,6 +828,10 @@
+ /**
+ * Stops and starts the WAR using buttons in the Control tab, and checks
+ * whether it's really stopped and started by sending HTTP requests.
+ */
public void testStopAndStartWar() throws IOException, EmbJoprTestException
{
final String DEPLOYABLE_NAME = BASIC_WAR_STOPSTART;
@@ -857,11 +866,12 @@
assertTrue("Page should contain 'HELLO WORLD'",
page.asText().contains("HELLO WORLD"));
// Refresh the page several times to increase the counter.
- page.refresh();
- page.refresh();
+ page = (HtmlPage) page.refresh();
+ page = (HtmlPage) page.refresh();
// Get the counter number.
- Integer count1 =
NumberUtils.createInteger(page.getBody().getHtmlElementById("count").getTextContent());
+ String count1text =
page.getBody().getHtmlElementById("count").getTextContent();
+ Integer count1 = NumberUtils.createInteger( count1text );
@@ -879,7 +889,7 @@
HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tr[contains(@class,
'rich-table-firstrow')]");
assertTrue( tr.getTextContent().contains("Success") );
/**/
- assertTrue(
ejtt.getTabMenu().getTabContentBox().getOperationHistoryTable().wasLastOperationSuccesful()
);
+ assertTrue(
ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful()
);
// Assert that the app is stopped.
@@ -891,9 +901,12 @@
ejtt.tabMenu.getTabContentBox().getButtonByLabel("Start").click();
// Check the latest message. TODO: EJTT class for ops history table?
- HtmlTable operationHistoryTable =
ejtt.getTabMenu().getTabContentBox().getOperationHistoryTable().getElement();
- HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tr[contains(@class,
'rich-table-firstrow')]");
+ /*
+ HtmlTable operationHistoryTable =
ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().getElement();
+ HtmlTableRow tr =
operationHistoryTable.getFirstByXPath("tbody/tr[contains(@class,
'rich-table-firstrow')]");
assertTrue( tr.getTextContent().contains("Success") );
+ */
+ assertTrue(
ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful()
);
// Assert that the app is running.
@@ -902,9 +915,11 @@
assertTrue(page.asText().contains("HELLO WORLD"));
// Get the counter number.
- Integer count2 =
NumberUtils.createInteger(page.getBody().getHtmlElementById("count").getTextContent());
+ String count2text =
page.getBody().getHtmlElementById("count").getTextContent();
+ Integer count2 = NumberUtils.createInteger( count2text );
- assertTrue( "Counter is reset upon app restart, thus should be lower
after.", count1 > count2 );
+ assertTrue( "Counter is reset upon app restart, thus should be lower after.
" +
+ "Old: "+count1text+" New: "+count2text, count1 > count2 );
}
@@ -915,7 +930,8 @@
/**
- * Restarts the WAR in Control tab and checks whether it was really restarted.
+ * Restarts the WAR using button in the Control tab,
+ * and checks whether it's really restarted by checking whether JSP variable was
reset.
*/
public void testRestartWar() throws IOException, EmbJoprTestException
{
@@ -950,11 +966,12 @@
assertTrue("Page should contain 'HELLO WORLD'",
page.asText().contains("HELLO WORLD"));
// Refresh the page several times to increase the counter.
- page.refresh();
- page.refresh();
+ page = (HtmlPage) page.refresh();
+ page = (HtmlPage) page.refresh();
// Get the counter number.
- Integer count1 =
NumberUtils.createInteger(page.getBody().getHtmlElementById("count").getTextContent());
+ String count1text =
page.getBody().getHtmlElementById("count").getTextContent();
+ Integer count1 = NumberUtils.createInteger( count1text );
@@ -967,9 +984,12 @@
ejtt.tabMenu.getTabContentBox().getButtonByLabel("Restart").click();
// Check the latest message. TODO: EJTT class for ops history table?
- HtmlTable operationHistoryTable =
ejtt.getTabMenu().getTabContentBox().getOperationHistoryTable().getElement();
- HtmlTableRow tr = operationHistoryTable.getFirstByXPath("tr[contains(@class,
'rich-table-firstrow')]");
+ /*
+ HtmlTable operationHistoryTable =
ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().getElement();
+ HtmlTableRow tr =
operationHistoryTable.getFirstByXPath("tbody/tr[contains(@class,
'rich-table-firstrow')]");
assertTrue( tr.getTextContent().contains("Success") );
+ */
+ assertTrue(
ejtt.getTabMenu().getTabContentBox().getOperationsHistoryTable().wasLastOperationSuccesful()
);
// Assert that the app is running.
@@ -978,13 +998,20 @@
assertTrue(page.asText().contains("HELLO WORLD"));
// Get the counter number.
- Integer count2 =
NumberUtils.createInteger(page.getBody().getHtmlElementById("count").getTextContent());
+ String count2text =
page.getBody().getHtmlElementById("count").getTextContent();
+ Integer count2 = NumberUtils.createInteger( count2text );
- assertTrue( "Counter is reset upon app restart, thus should be lower
after.", count1 > count2 );
+ assertTrue( "Counter is reset upon app restart, thus should be lower after.
" +
+ "Old: "+count1text+" New: "+count2text, count1 > count2 );
}
finally {
- undeployWAR(DEPLOYABLE_NAME);
+ try {
+ undeployWAR(DEPLOYABLE_NAME);
+ } catch( Exception ex ){
+ DebugUtils.writeFile("testRestartWar-undeploy.html",
client.getPageAsText());///
+ log.debug("Cathed an expected exception when trying to undeploy
"+DEPLOYABLE_NAME+": "+ex );
+ }
}
}
@@ -1002,7 +1029,7 @@
// Deploy the WAR.
String WARFilePath = ejtt.getTestDataDir() + "/war/"+DEPLOYABLE_NAME;
- deployWarRepeatedly( WARFilePath );
+ deployWAR( WARFilePath );
try {
Property changes on: trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/tc
___________________________________________________________________
Name: svn:ignore
+ ejb3
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-04-06
21:23:13 UTC (rev 277)
+++
trunk/jsfunit/src/test/java/org/jboss/jopr/jsfunit/util/EmbJoprTestToolkit.java 2009-04-07
16:50:10 UTC (rev 278)
@@ -242,6 +242,14 @@
public NavTreeNode getNodeByLabel( String label, boolean throwIfNotFound ) throws
HtmlElementNotFoundException{
DomElement navTreeForm = (DomElement)client.getElement(ID_NAV_TREE_FORM);
+ if( null == navTreeForm ){
+ try {
+ DebugUtils.writeFile("getNodeByLabel-IDnotFound.html",
client.getPageAsText());
+ }catch(Exception ex){
+ log.error("Caught when writing file: "+ex);
+ }
+ throw new HtmlElementNotFoundException("Nav tree form not found using ID:
"+ID_NAV_TREE_FORM);
+ }
// A table which has an anchor containing given text.
// Note: Different node types have different id endings - typeSummaryLink,
categorySummaryLink, ...
@@ -625,20 +633,44 @@
* @see ContentTable#ContentTable()
*/
public ContentTable getDefaultTable() throws HtmlElementNotFoundException{
- return new ContentTable();
+
+ // Find the data table - try some known IDs.
+ String[] elemIDs = { ContentTable.ID_CATEGORY_DATA_TABLE,
+ ContentTable.ID_RESOURCE_DATA_TABLE };
+ Element elem = null;
+ for( String elemID : elemIDs ){
+ elem = client.getElement(elemID);
+ if( null != elem )
+ break;
+ }
+ if( null == elem )
+ throw new HtmlElementNotFoundException(
+ "Can't find the content table element, searched IDs: "
+ + StringUtils.join(elemIDs, ", ") );
+
+ return new ContentTable( (HtmlTable)elem );
+
}
/**
* Returns the operation history table from the Content tab.
*/
- public OperationsHistoryTable getOperationHistoryTable() throws
HtmlElementNotFoundException
- {
- //HtmlTable table = (HtmlTable)
client.getElement("operationHistoryForm:dataTable");
- //return new OperationsHistoryTable(table);
- return new OperationsHistoryTable();
+ public OperationsHistoryTable getOperationsHistoryTable() throws
HtmlElementNotFoundException {
+
+ // Find the ops history table.
+ String elemID = "operationHistoryForm:dataTable";
+ Element elem = client.getElement(elemID);
+ if( null == elem ){
+ throw new HtmlElementNotFoundException(
+ "Can't find the ops history table element, searched ID: " +
elemID);
+ }
+
+ return new OperationsHistoryTable( (HtmlTable)elem );
+
}
+
/**
* Finds first button with given label inside this box.
* @param label
@@ -748,6 +780,7 @@
* If not, it simply returns the first in the order of IDs searched.
* You can always specify the element using ContentTable( HtmlTable element ).
*/
+ /*
public ContentTable() throws HtmlElementNotFoundException {
// Find the data table - try some known IDs.
@@ -761,10 +794,11 @@
if( null == elem )
throw new HtmlElementNotFoundException(
"Can't find the content table element, searched IDs: "
- + elemIDs.toString() );
+ + StringUtils.join(elemIDs, ", ") );
this.element = (HtmlTable)elem;
}
+ */
// Columns maps
@@ -927,11 +961,9 @@
*
* This is a shortcut for ejtt.getTabMenu().getTabContentBox().getDefaultTable(),
* which we can do because it searches the element using ID.
- *
- * @see ContentTable#ContentTable()
*/
public ContentTable getDefaultContentTable() throws HtmlElementNotFoundException{
- return new ContentTable();
+ return this.getTabMenu().getTabContentBox().getDefaultTable();
}
@@ -958,7 +990,7 @@
Properties props = new Properties();
// The template has label in span/strong and the value as text in td.
- String xPath = ".//tr/td[span/strong | strong]";
+ String xPath = ".//tr/td[span/strong | strong | b]";
//String xPath = ".//tr/td[span/strong] | .//tr/td[.//strong]";
List<HtmlTableCell> cells = (List<HtmlTableCell>)
this.getElement().getByXPath(xPath);
for( HtmlTableCell cell : cells ){
@@ -986,19 +1018,6 @@
public class OperationsHistoryTable extends ContentTable {
- public OperationsHistoryTable() throws HtmlElementNotFoundException {
-
- // Find the ops history table.
- String elemID = "operationHistoryForm:dataTable";
- Element elem = client.getElement(elemID);
- if( null == elem ){
- throw new HtmlElementNotFoundException(
- "Can't find the ops history table element, searched ID: " +
elemID);
- }
-
- this.element = (HtmlTable)elem;
- }
-
public OperationsHistoryTable(HtmlTable element) {
super(element);
}
@@ -1010,7 +1029,7 @@
throw new HtmlElementNotFoundException(
"Operation table has no rows (no operations are listed).");
- String xPath = "tr[contains(@class, 'rich-table-firstrow')]";
+ String xPath = "tbody/tr[contains(@class, 'rich-table-firstrow')]";
HtmlTableRow tr = this.element.getFirstByXPath(xPath);
if( null == tr ){
throw new HtmlElementNotFoundException(