...in a Nutshell
René Schwietzke, Xceptance
Just to get an idea what is coming
Feel free to ask any question, anytime
XLT is a load and performance testing tool
Just some facts about the history of XLT.
This tool is for you, when...
This isn't your tool, when...
Open and Flexible
*) HtmlUnit, HttpClient, JUnit, **) either standalone or soon in XTC
Windows-only is not an option and never was one
XLT is written in Java, tests are in Java*.
* Spoiler alert - we have non-Java test suites as well
Do not reinvent the wheel. Use what is proven.
The Important Pieces
The high level overview
Agents can be anywhere. HTTPS communication and authentication, just one open port needed.
*) Optional
Makes test projects more easily manageable
Requires GIT or similar tools
Your console for test execution - short name MC
Only the interactive mode permits (re)attaching, even to tests of others.
Waits, receives, and distributes workload - short name AC
The AC is usually a don't-care component.
The workhorse of the load test and a component to watch
The tuning and sizing part is important for good and consistent results. We will get back to that topic later.
Many ways to write tests
public class Search extends AbstractHtmlPageAction
{
public Search(AbstractHtmlPageAction prevAction, String searchPhrase)
{
super(prevAction);
this.searchPhrase = searchPhrase;
}
public void preValidate() throws Exception
{
HtmlPage p = getPreviousAction().getHtmlPage();
searchField = p.getByXPath("id('q')");
Assert.assertNotNull(searchField);
}
public void execute() throws Exception
{
// Fill in search phrase
searchField.setAttribute("value", this.searchPhrase);
// Click on 'Search'
loadPageByClick(searchButton);
}
public void postValidate() throws Exception
{
// response code = 200 ?
HttpResponseCodeValidator.getInstance().validate(p);
List result = p.getByXPath(this.searchResultPath);
Assert.assertEquals(1, result.size());
}
}
Powerful including great form handling.
public class ViewCart extends PageAction<ViewCart>
{
@Override
protected void doExecute() throws Exception
{
// Get mini cart link.
final HtmlElement cartLink =
GeneralPages.instance.miniCart.getViewCartLink().asserted().single();
// Click it.
loadPageByClick(cartLink);
}
@Override
protected void postValidate() throws Exception
{
// this was a page load, so validate what is important
Validator.validatePageSource();
// basic checks for the cart
CartPage.instance.validate();
}
}
Prevalidation returns as isPossible()
// Send a post request which contains form data parameters.
final String lastId = Actions.get("Post Form Data Parameter", t ->
{
final String id = String.valueOf(XltRandom.nextInt());
// let's submit some post parameter (form data)
final HttpResponse response = new HttpRequest().timerName(t)
.baseUrl("https://postman-echo.com")
.relativeUrl("/post/")
.param("id", id)
.param("foo", "true")
.param("bar", "false")
.param("parameter", "value")
.method(HttpMethod.POST)
.fire();
response.checkStatusCode(200);
final String responseContent = response.getContentAsString();
// Ok, get us some response content for validation and use the jsonpath query
// language for that.
final ReadContext ctx = JsonPath.parse(responseContent);
Assert.assertTrue(Boolean.valueOf(ctx.read("$.form.foo", String.class)));
Assert.assertFalse(Boolean.valueOf(ctx.read("$.form.bar", String.class)));
Assert.assertNotNull(Boolean.valueOf(ctx.read("$.form.parameter")));
// Also let's return the id from the response.
final String responseId = ctx.read("$.form.id", String.class);
Assert.assertEquals(id, responseId);
return responseId;
});
Prevalidation returns as isPossible()
- Action:
Name : Homepage
Request :
Url : ${host}/posters/
Response :
Httpcode : 200
Validate:
- Title:
XPath: id('titleIndex')
Matches: "\\w out our *"
- Button:
XPath: id('btnShowLoginForm')
- MenuList :
XPath : id('login-form')/ul/li[@name='Women']
Count : 17
- Header :
XPath: id('titleIndex')
Text: "Check out our new panorama posters!"
- ShowCard-Button :
XPath : "/html/body/div[1]/div[2]/div/button[1]"
Subrequests:
- Static:
- ${host}/posters/assets/css/bootstrap-2.3.1.min.css
- ${host}/posters/assets/css/bootstrap-responsive-2.0.4.css
https://github.com/Xceptance/testsuite-nocoding
Execute tests locally to develop and verify
See next slide for result browser.
See the data transferred in detail
Most awesome when investigating load test errors
Running a test remotely
user@machine ~/xlt-4.10.1/bin $ ./mastercontroller.sh
Xceptance LoadTest 4.10.1 (r28afdd4d06)
Copyright (c) 2005-2018 Xceptance Software Technologies GmbH. All rights reserved.
Basic License (5 virtual users). This license does not expire.
Checking for agent controller reachability and XLT version conflicts ... OK
-----------------------------------------------
What do you want to do?
-----------------------------------------------
(u) Upload test suite
(s) Start test
(r) Report test status
(d) Download test results
(c) Create test report
(a) Abort test
(p) Ping agent controllers
(i) Show agent controller information
(q) Quit
=> u
Uploading test suite...
Preparing: 0% .. 10% .. 20% .. 30% .. 50% .. 60% .. 70% .. 80% .. 100% - OK
Uploading: 0% .. 20% .. 40% .. 60% .. 80% .. 100% - OK
Starting agents...
0% ... 100% - OK
Load Profile
-------------------------------------------------------------------------------
Test Case | Arrival Rate [eff] | Users [eff] | Load Factor | Measurement Period
-------------------------------------------------------------------------------
TOrder | n/a | 1..5 | n/a | 0:05:00
-------------------------------------------------------------------------------
0 | 5 | n/a | 0:05:00
Infinite test setups with reuse possible
That is not all of course.
What the test setup permits
That is not all of course.
Totally flexible load profiles
Scale up or scale down easily by using the factor feature.
Standard reports and extra features
Open data for custom analytics, modification, and reporting
R,Homepage.1,1440421580217,267,false,255,2830,200,http://localhost:8080/posters/,text/html,1,0,0,0,19,19,
R,Homepage.1.8,1440421580687,28,false,457,306680,200,http://localhost:8080/posters/img/products/XXL/XXL_4.jpg,image/jpeg,0,0,7,13,7,20,
A,SelectCategory,1440421583179,1094,false
T,TBrowse,1440421578625,8189,false,,
Perfect for searching things outside the ordinary.
Ready to use reporting
See the change
See the trend
Monitor your test progress in realtime
We have an AWS image available.
What can be added
That is not all of course.
What you can do to get more details
That is not all of course.
A real browser as engine
The need for Client Performance Testing (CPT) explained
We want to see the whole picture and not just pure network.
Use WebDriver API scripts and measure with a real browser
Chrome has even more events.
Lot of data.
Some more unsorted information
Results can be further worked on.
All due to the open storage format.
Feel free to ask