Skip to content

Commit

Permalink
Release 5.4.1
Browse files Browse the repository at this point in the history
  • Loading branch information
jowerner committed May 17, 2021
2 parents 5b5962b + 4e8d5d1 commit 5a6164b
Show file tree
Hide file tree
Showing 16 changed files with 153 additions and 20 deletions.
8 changes: 8 additions & 0 deletions doc/xltdoc/_includes/breadcrumb.html
Original file line number Diff line number Diff line change
@@ -1,6 +1,14 @@

{% assign pathElements = page.path | split:"/" %}

<div class="container-fluid bg-danger" id="legacy">
<div class="pull-left"><i class="fa fa-warning"></i></div>
<p class="title">Legacy Documentation</p>
<p>
This is the old XLT documentation which is here for reference purposes only. You can find the <strong>latest version at <a href="https://xltdoc.xceptance.com/">xltdoc.xceptance.com</a></strong>.
</p>
</div>

<div id="breadcrumb" class="navbar navbar-default">
<div>
<ol class="breadcrumb">
Expand Down
23 changes: 23 additions & 0 deletions doc/xltdoc/css/xltdoc.less
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
4 changes: 2 additions & 2 deletions doc/xltdoc/getting-started/01-test-automation.textile
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
22 changes: 22 additions & 0 deletions doc/xltdoc/release-notes/5.4.x.textile
Original file line number Diff line number Diff line change
Expand Up @@ -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 <xlink:href> to value </some/path/to/icon.svg#icon-search>

Happened for pages using @<svg>@ elements, but other elements could have been affected as well. This issue is fixed now.



h2. XLT 5.4.0

h3. Load Testing
Expand Down
12 changes: 11 additions & 1 deletion doc/xltdoc/release-notes/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,18 @@ <h2><i class="fa fa-book"></i> XLT Release Notes</h2>
<p class="lead">Select a version to read the release information and get informed about new features, improvements, and fixes.</p>
</div>

<div class="alert alert-danger" role="alert">
<p>
<span class="fa fa-warning" aria-hidden="true"></span>
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 <a href="https://xltdoc.xceptance.com/release-notes/">https://xltdoc.xceptance.com/release-notes/</a>.
</p>
<p>
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 <a href="https://github.com/Xceptance/xlt-documentation">GitHub</a>.
</p>
</div>

<div>
<ul class="list-unstyled visible-xs">
{% include nav-links.html para=true %}
{% include nav-links.html para=true %}
</ul>
</div>
7 changes: 4 additions & 3 deletions doc/xltdoc/user-manual/02-install.textile
Original file line number Diff line number Diff line change
Expand Up @@ -13,16 +13,17 @@ 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

Unzip the XLT archive to a file system location of your choice. The root directory is part of the archive, so you don't need to create it separately. XLT supports spaces in the path; however, it's easier to code tests when the path is free of them.

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.
Expand Down
2 changes: 2 additions & 0 deletions doc/xltdoc/user-manual/03-scriptdeveloper.textile
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down
10 changes: 10 additions & 0 deletions doc/xltdoc/user-manual/index.html
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,16 @@ <h2><i class="fa fa-book"></i> User Manual</h2>
<p class="lead">A comprehensive User Manual to learn Xceptance LoadTest in detail.</p>
</div>

<div class="alert alert-danger" role="alert">
<p>
<span class="fa fa-warning" aria-hidden="true"></span>
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 <a href="https://xltdoc.xceptance.com/load-testing/manual/">https://xltdoc.xceptance.com/load-testing/manual/</a>.
</p>
<p>
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 <a href="https://github.com/Xceptance/xlt-documentation">GitHub</a>.
</p>
</div>

<div>
<ul class="list-unstyled visible-xs">
{% include nav-links.html para=true %}
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.xceptance</groupId>
<artifactId>xlt</artifactId>
<version>5.4.0</version>
<version>5.4.1</version>
<packaging>jar</packaging>

<name>XLT</name>
Expand Down
4 changes: 4 additions & 0 deletions samples/testsuite-performance/config/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions samples/testsuite-posters/config/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions samples/testsuite-showcases/config/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions samples/testsuite-template/config/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
4 changes: 4 additions & 0 deletions samples/testsuite-xlt/config/log4j.properties
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
37 changes: 24 additions & 13 deletions src/main/java/com/xceptance/xlt/engine/resultbrowser/DomUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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.
Expand All @@ -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.
*/
Expand Down Expand Up @@ -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;
}
Expand All @@ -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;
Expand All @@ -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;
Expand All @@ -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;
Expand Down Expand Up @@ -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;
Expand Down Expand Up @@ -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;
Expand All @@ -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()));
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 = "<html><head></head><body><div class=\"search\"><svg class=\"null auc-icon--search\">" +
"<use xlink:href=\"/some/path/to/icon.svg\" xlink:title=\"Search Icon\" xml:space=\"preserve\"></use>" +
"</svg></div></body></html>";
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()));
}
}
}

0 comments on commit 5a6164b

Please sign in to comment.