Author: dsvyatobatsko
Date: 2008-10-24 04:37:29 -0400 (Fri, 24 Oct 2008)
New Revision: 10890
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
Log:
fixed FF incompatibility
Modified:
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java
===================================================================
---
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-10-23
17:57:42 UTC (rev 10889)
+++
trunk/test-applications/seleniumTest/richfaces/src/test/java/org/richfaces/SeleniumTestBase.java 2008-10-24
08:37:29 UTC (rev 10890)
@@ -962,15 +962,22 @@
// //div[contains(@style, "font-size: 14px") and contains(@class,
"dr-pnlbar-c rich-panelbar-content")]
String xpath = "";
if (locator.startsWith("//")) {
- xpath = locator + String.format("[contains(@%1$s,
\"%2$s\")]", attrName, expectedExpression);
+ xpath = locator + "/@" + attrName;
} else {
- xpath = String.format("[contains(@%1$s, \"%2$s\") and
@id=\"%3$s\"]", attrName, expectedExpression, locator);
+ xpath = String.format("//*[@id='@%1$s']/@%2$s", locator,
attrName);
}
- if (selenium.getXpathCount(xpath).intValue() == 0) {
+ String attrValue = null;
+ try {
+ attrValue = selenium.getAttribute(xpath);
+ } catch (Throwable e) {
+ // consume exception
+ }
+
+ if (null == attrValue ||
!attrValue.toLowerCase().contains(expectedExpression.toLowerCase())) {
String failureMsg = String.format(
- "Attribute [%1$s] of element [%2$s] doesn't contain expected
expression [%3$s]", attrName, locator,
- expectedExpression);
+ "Attribute [%1$s] = [%4$s] of element [%2$s] doesn't contain
expected expression [%3$s]", attrName, locator,
+ expectedExpression, attrValue);
if (null != message && !"".equals(message.trim())) {
failureMsg = message + ": " + failureMsg;
}
Show replies by date