+ This is the old XLT documentation which is here for reference purposes only. You can find the latest version at xltdoc.xceptance.com.
+
+
+
diff --git a/doc/xltdoc/css/xltdoc.less b/doc/xltdoc/css/xltdoc.less
index aa584d68d..a6db8207f 100644
--- a/doc/xltdoc/css/xltdoc.less
+++ b/doc/xltdoc/css/xltdoc.less
@@ -72,6 +72,29 @@ body {
}
}
+#legacy {
+ margin: 0;
+ padding: 10px 10px 0px 10px;
+
+ border:none;
+ border-radius: 0;
+
+ i {
+ font-size: 4* @manual-base-font-size;
+ color: @blockquote-danger-border-color;
+ margin-right: 10px;
+ }
+ p {
+ font-size: @manual-base-font-size;
+ }
+
+ .title {
+ font-size: 1.2 * @manual-base-font-size;
+ color: @blockquote-danger-border-color;
+ font-weight: 500;
+ }
+}
+
#main {
background-color: @dimmed-bg;
}
diff --git a/doc/xltdoc/getting-started/01-test-automation.textile b/doc/xltdoc/getting-started/01-test-automation.textile
index 353efb80e..78e9c25b2 100644
--- a/doc/xltdoc/getting-started/01-test-automation.textile
+++ b/doc/xltdoc/getting-started/01-test-automation.textile
@@ -14,9 +14,9 @@ Web test automation with XLT can be done using the UI based record and replay to
h3. XLT Script Developer
-p(illustration). !../img/user-manual/ScriptDev_MainWindow-small.png(Script Developer)!:../img/user-manual/ScriptDev_MainWindow.png %(caption)Script Developer UI%
+bq(error). *Script Developer is discontinued.* Firefox 57 and higher no longer support XUL/XPCOM-based browser extensions (aka legacy extensions); these have been replaced with extensions built upon the WebExtension API. As a consequence, Script Developer cannot be installed and won't work in Firefox 57 and above. Exporting the XML script test cases to Java-based script test cases is the designated migration path. Please see the "how-to section for a migration guide":../how-to/from-scriptdeveloper-to-java.html.
-bq(warning). Firefox 57 and higher no longer support XUL/XPCOM-based browser extensions (aka legacy extensions); these have been replaced with extensions built upon the WebExtension API. As a consequence, Script Developer cannot be installed and won't work in Firefox 57 and above. Therefore Script Developer is discontinued. Exporting the XML script test cases to Java-based script test cases is the designated migration path. Please see the "how-to section for a migration guide":../how-to/from-scriptdeveloper-to-java.html.
+p(illustration). !../img/user-manual/ScriptDev_MainWindow-small.png(Script Developer)!:../img/user-manual/ScriptDev_MainWindow.png %(caption)Script Developer UI%
h4. Script Developer is a Firefox Add-on
diff --git a/doc/xltdoc/release-notes/5.4.x.textile b/doc/xltdoc/release-notes/5.4.x.textile
index 24ec41196..2f29ee8f9 100644
--- a/doc/xltdoc/release-notes/5.4.x.textile
+++ b/doc/xltdoc/release-notes/5.4.x.textile
@@ -5,6 +5,28 @@ position: 980
sorted: true
---
+h2. XLT 5.4.1
+
+h3. Documentation reworked extensively
+
+The XLT documentation has been reworked extensively and is now hosted at "https://xltdoc.xceptance.com/":https://xltdoc.xceptance.com/. Please have a look and let us know what you think about it! You can also actively participate in improving the XLT documentation by providing pull requests, suggesting topics, and raising issues. The related Git repository can be found on "GitHub":https://github.com/Xceptance/xlt-documentation.
+
+XLT still ships with the old documentation for a while, as a reference manual especially for those of you who still use XML script test cases for test automation. But note that we will remove the old docs altogether with the next major release.
+
+
+h3. Test Framework
+
+h4. Warnings when cloning a page after an action has finished
+
+After an @HtmlPageAction@ has finished, XLT snapshots the current HTML page and stores the clone away to be presented later on in the result browser. During that process, XLT could print warnings similar to the following to the console:
+
+bc(plain).
+Failed to set attribute to value
+
+Happened for pages using @
+
+
+
+ You are viewing the legacy version of the XLT documentation and hence the release notes are not longer up-to-date. The latest version can be found at https://xltdoc.xceptance.com/release-notes/.
+
+
+ You can also actively participate in improving the XLT documentation by providing pull requests, suggesting topics, and raising issues. The related repository can be found on GitHub.
+
+
+
- {% include nav-links.html para=true %}
+ {% include nav-links.html para=true %}
diff --git a/doc/xltdoc/user-manual/02-install.textile b/doc/xltdoc/user-manual/02-install.textile
index b3912e524..1740c2fe1 100644
--- a/doc/xltdoc/user-manual/02-install.textile
+++ b/doc/xltdoc/user-manual/02-install.textile
@@ -13,9 +13,8 @@ h3. Hardware
h3. Software
-* Operating System: Microsoft Windows, Linux, Oracle Solaris, HP-UX, or Mac OS X, that is any operating system for which a JVM 7 (or higher) is available.
-* JVM: It's recommended to use Oracle's JVM. XLT also runs on OpenJDK. JVMs provided by vendors such as OpenJDK BEA, HP, or IBM have not been tested extensively and may or may not work.
-* Browser: Firefox, Chrome, Internet Explorer 10, or Safari 6 for the HTML load reports. Note that JavaScript has to be enabled to utilize all functionality. If you want to use XLT Script Developer, you need to have Firefox 31 (or higher).
+* Operating System: Microsoft Windows, Linux, or Mac OS X, that is any operating system for which a JVM 8 (or higher) is available.
+* Browser: Firefox, Chrome, Internet Explorer 10, or Safari 6 for the HTML load reports. Note that JavaScript has to be enabled to utilize all functionality.
h2. Installing XLT
@@ -23,6 +22,8 @@ Unzip the XLT archive to a file system location of your choice. The root directo
Make sure the executable directory of your Java installation is listed in your @PATH@ environment variable so that the XLT start scripts can find the JVM runtime.
+bq(error). *Script Developer is discontinued and not longer supported for all current Firefox releases.*
+
To install the XLT Script Developer extension for Firefox, you need to:
* Start Firefox.
diff --git a/doc/xltdoc/user-manual/03-scriptdeveloper.textile b/doc/xltdoc/user-manual/03-scriptdeveloper.textile
index caa29dcb9..9fed561df 100644
--- a/doc/xltdoc/user-manual/03-scriptdeveloper.textile
+++ b/doc/xltdoc/user-manual/03-scriptdeveloper.textile
@@ -5,6 +5,8 @@ title: Script Developer
h2. Introduction
+bq(error). *Script Developer is discontinued.* Firefox 57 and higher no longer support XUL/XPCOM-based browser extensions (aka legacy extensions); these have been replaced with extensions built upon the WebExtension API. As a consequence, Script Developer cannot be installed and won't work in Firefox 57 and above. Exporting the XML script test cases to Java-based script test cases is the designated migration path. Please see the "how-to section for a migration guide":../how-to/from-scriptdeveloper-to-java.html.
+
XLT Script Developer is a Firefox extension used to create test case scripts. Script test cases are based on a simple syntax and a reduced set of operations, which makes them a perfect fit for non-programmers. Besides Script Developer, no other tool is necessary to create, edit, and manage basic script test cases.
Script Developer _records_ test cases, that is you simply use an application you want to test while your actions are being recorded in the background and stored to an XML script file. During recording, you can add commands to perform validations on the page. Any recorded value can later be extracted from the script into a test data file to separate test data from script code. Scripts may also be exported as ordinary Java code.
diff --git a/doc/xltdoc/user-manual/index.html b/doc/xltdoc/user-manual/index.html
index 8a4b1619f..66a5563ac 100644
--- a/doc/xltdoc/user-manual/index.html
+++ b/doc/xltdoc/user-manual/index.html
@@ -10,6 +10,16 @@
User Manual
A comprehensive User Manual to learn Xceptance LoadTest in detail.
+
+
+
+ You are viewing the legacy version of the XLT documentation. This user manual might not longer be up-to-date. The latest version can be found at https://xltdoc.xceptance.com/load-testing/manual/.
+
+
+ You can also actively participate in improving the XLT documentation by providing pull requests, suggesting topics, and raising issues. The related repository can be found on GitHub.
+
+
+
{% include nav-links.html para=true %}
diff --git a/pom.xml b/pom.xml
index c1c0055de..74289080a 100644
--- a/pom.xml
+++ b/pom.xml
@@ -6,7 +6,7 @@
com.xceptancexlt
- 5.4.0
+ 5.4.1jarXLT
diff --git a/samples/testsuite-performance/config/log4j.properties b/samples/testsuite-performance/config/log4j.properties
index 37e286cb5..c37842015 100644
--- a/samples/testsuite-performance/config/log4j.properties
+++ b/samples/testsuite-performance/config/log4j.properties
@@ -14,6 +14,10 @@ log4j.logger.runtime = warn
log4j.logger.com.xceptance = warn
log4j.logger.com.gargoylesoftware.htmlunit = warn
+# Uncomment the following line to suppress log messages about failed DOM operations while cloning parsed HTML documents
+# such as "Failed to set attribute <...> to value <...>" or "Failed to clone page".
+#log4j.logger.com.xceptance.xlt.engine.resultbrowser.DomUtils = fatal
+
# Suppress log messages about obsolete MIME types, etc. Deactivate if necessary.
log4j.logger.com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl = fatal
diff --git a/samples/testsuite-posters/config/log4j.properties b/samples/testsuite-posters/config/log4j.properties
index 37e286cb5..c37842015 100644
--- a/samples/testsuite-posters/config/log4j.properties
+++ b/samples/testsuite-posters/config/log4j.properties
@@ -14,6 +14,10 @@ log4j.logger.runtime = warn
log4j.logger.com.xceptance = warn
log4j.logger.com.gargoylesoftware.htmlunit = warn
+# Uncomment the following line to suppress log messages about failed DOM operations while cloning parsed HTML documents
+# such as "Failed to set attribute <...> to value <...>" or "Failed to clone page".
+#log4j.logger.com.xceptance.xlt.engine.resultbrowser.DomUtils = fatal
+
# Suppress log messages about obsolete MIME types, etc. Deactivate if necessary.
log4j.logger.com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl = fatal
diff --git a/samples/testsuite-showcases/config/log4j.properties b/samples/testsuite-showcases/config/log4j.properties
index 37e286cb5..c37842015 100644
--- a/samples/testsuite-showcases/config/log4j.properties
+++ b/samples/testsuite-showcases/config/log4j.properties
@@ -14,6 +14,10 @@ log4j.logger.runtime = warn
log4j.logger.com.xceptance = warn
log4j.logger.com.gargoylesoftware.htmlunit = warn
+# Uncomment the following line to suppress log messages about failed DOM operations while cloning parsed HTML documents
+# such as "Failed to set attribute <...> to value <...>" or "Failed to clone page".
+#log4j.logger.com.xceptance.xlt.engine.resultbrowser.DomUtils = fatal
+
# Suppress log messages about obsolete MIME types, etc. Deactivate if necessary.
log4j.logger.com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl = fatal
diff --git a/samples/testsuite-template/config/log4j.properties b/samples/testsuite-template/config/log4j.properties
index 37e286cb5..c37842015 100644
--- a/samples/testsuite-template/config/log4j.properties
+++ b/samples/testsuite-template/config/log4j.properties
@@ -14,6 +14,10 @@ log4j.logger.runtime = warn
log4j.logger.com.xceptance = warn
log4j.logger.com.gargoylesoftware.htmlunit = warn
+# Uncomment the following line to suppress log messages about failed DOM operations while cloning parsed HTML documents
+# such as "Failed to set attribute <...> to value <...>" or "Failed to clone page".
+#log4j.logger.com.xceptance.xlt.engine.resultbrowser.DomUtils = fatal
+
# Suppress log messages about obsolete MIME types, etc. Deactivate if necessary.
log4j.logger.com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl = fatal
diff --git a/samples/testsuite-xlt/config/log4j.properties b/samples/testsuite-xlt/config/log4j.properties
index 37e286cb5..c37842015 100644
--- a/samples/testsuite-xlt/config/log4j.properties
+++ b/samples/testsuite-xlt/config/log4j.properties
@@ -14,6 +14,10 @@ log4j.logger.runtime = warn
log4j.logger.com.xceptance = warn
log4j.logger.com.gargoylesoftware.htmlunit = warn
+# Uncomment the following line to suppress log messages about failed DOM operations while cloning parsed HTML documents
+# such as "Failed to set attribute <...> to value <...>" or "Failed to clone page".
+#log4j.logger.com.xceptance.xlt.engine.resultbrowser.DomUtils = fatal
+
# Suppress log messages about obsolete MIME types, etc. Deactivate if necessary.
log4j.logger.com.gargoylesoftware.htmlunit.IncorrectnessListenerImpl = fatal
diff --git a/src/main/java/com/xceptance/xlt/engine/resultbrowser/DomUtils.java b/src/main/java/com/xceptance/xlt/engine/resultbrowser/DomUtils.java
index 915012436..edd93cca9 100644
--- a/src/main/java/com/xceptance/xlt/engine/resultbrowser/DomUtils.java
+++ b/src/main/java/com/xceptance/xlt/engine/resultbrowser/DomUtils.java
@@ -18,9 +18,11 @@
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
+import org.apache.commons.lang3.ObjectUtils;
import org.apache.commons.lang3.StringUtils;
+import org.apache.commons.logging.Log;
+import org.apache.commons.logging.LogFactory;
import org.apache.commons.text.StringEscapeUtils;
-import org.apache.log4j.Level;
import org.w3c.dom.Attr;
import org.w3c.dom.CDATASection;
import org.w3c.dom.Comment;
@@ -38,7 +40,6 @@
import com.gargoylesoftware.htmlunit.html.HtmlPage;
import com.gargoylesoftware.htmlunit.html.HtmlTemplate;
import com.xceptance.common.util.ParameterCheckUtils;
-import com.xceptance.xlt.api.util.XltLogger;
/**
* Utility methods for the W3C DOM API classes.
@@ -47,6 +48,12 @@
*/
final class DomUtils
{
+
+ /**
+ * Class logger.
+ */
+ private static final Log LOG = LogFactory.getLog(DomUtils.class);
+
/**
* Default constructor. Declared private to prevent external instantiation.
*/
@@ -84,7 +91,7 @@ private static Node cloneNode(final Node node, final Document document)
// null
if (node != null)
{
- XltLogger.runTimeLogger.warn("Don't know how to clone this node: " + node.getClass());
+ LOG.warn("Don't know how to clone this node: " + node.getClass());
}
return null;
}
@@ -106,7 +113,7 @@ private static Node cloneCDATA(final CDATASection node, final Document document)
}
catch (final DOMException dex)
{
- XltLogger.runTimeLogger.warn("Failed to create CDATA section", dex);
+ LOG.warn("Failed to create CDATA section", dex);
}
return null;
@@ -129,7 +136,7 @@ private static Node cloneText(final Text node, final Document document)
}
catch (final DOMException dex)
{
- XltLogger.runTimeLogger.warn("Failed to create text node", dex);
+ LOG.warn("Failed to create text node", dex);
}
return null;
@@ -152,7 +159,7 @@ private static Node cloneComment(final Comment node, final Document document)
}
catch (final DOMException dex)
{
- XltLogger.runTimeLogger.warn("Failed to create comment node", dex);
+ LOG.warn("Failed to create comment node", dex);
}
return null;
@@ -204,7 +211,7 @@ public static PageDOMClone clonePage(final HtmlPage page)
}
catch (final Exception e)
{
- XltLogger.runTimeLogger.error("Failed to clone page " + page, e);
+ LOG.error("Failed to clone page " + page, e);
}
return null;
@@ -269,15 +276,17 @@ private static Node cloneElementNode(final Element node, final PageDOMClone page
// create the clone
final Element clone;
+ final String nodeNS = node.getNamespaceURI();
try
{
- clone = pageClone.getDocument().createElement(node.getTagName());
+ // GH#88: Make sure to create the clone with same namespaceURI as the original.
+ clone = pageClone.getDocument().createElementNS(nodeNS, node.getTagName());
}
catch (final DOMException dex)
{
- if (XltLogger.runTimeLogger.isEnabledFor(Level.WARN))
+ if (LOG.isWarnEnabled())
{
- XltLogger.runTimeLogger.warn("Failed to clone element node " + node);
+ LOG.warn("Failed to clone element node " + node);
}
return null;
@@ -292,13 +301,15 @@ private static Node cloneElementNode(final Element node, final PageDOMClone page
{
// XLT#1954: Attribute values of the clone have to be escaped correctly since the raw value of the
// original attribute is not available anymore and their node value is already unescaped.
- clone.setAttributeNS(attribute.getNamespaceURI(), attribute.getName(), StringEscapeUtils.escapeHtml4(attribute.getValue()));
+ final String value = StringEscapeUtils.escapeHtml4(attribute.getValue());
+ // GH#88: Use namespaceURI of attribute and fall back to namespaceURI of owner element node if not set.
+ clone.setAttributeNS(ObjectUtils.defaultIfNull(attribute.getNamespaceURI(), nodeNS), attribute.getName(), value);
}
catch (final DOMException dex)
{
- if (XltLogger.runTimeLogger.isEnabledFor(Level.WARN))
+ if (LOG.isWarnEnabled())
{
- XltLogger.runTimeLogger.warn(String.format("Failed to set attribute <%s> to value <%s>", attribute.getName(),
+ LOG.warn(String.format("Failed to set attribute <%s> to value <%s>", attribute.getName(),
attribute.getValue()));
}
}
diff --git a/src/test/java/com/xceptance/xlt/engine/resultbrowser/DomUtilsTest.java b/src/test/java/com/xceptance/xlt/engine/resultbrowser/DomUtilsTest.java
index ca7769612..6d3f4ec3a 100644
--- a/src/test/java/com/xceptance/xlt/engine/resultbrowser/DomUtilsTest.java
+++ b/src/test/java/com/xceptance/xlt/engine/resultbrowser/DomUtilsTest.java
@@ -190,4 +190,30 @@ public void testClonePage_TemplateElement() throws Throwable
Assert.assertEquals(content, new HtmlDomPrinter().printNode(clone.getDocument()));
}
}
+
+ /**
+ * Tests if SVG attributes are correctly cloned as fix of GitHub issue #88.
+ *
+ * @throws Throwable
+ */
+ @Test
+ public void testClonePage_SVGElement() throws Throwable
+ {
+ final URL url = new URL("http://localhost/");
+ final MockWebConnection conn = new MockWebConnection();
+ final String content = "";
+ conn.setResponse(url, content);
+
+ try (final WebClient wc = new WebClient(BrowserVersion.CHROME))
+ {
+ wc.setWebConnection(conn);
+
+ final HtmlPage page = wc.getPage(url);
+ final PageDOMClone clone = DomUtils.clonePage(page);
+
+ Assert.assertEquals(content, new HtmlDomPrinter().printNode(clone.getDocument()));
+ }
+ }
}