Managing state between steps
Introducing Thucydides
Thucydides on Github
Thucydides on Java.net
News
Presentations
Releases
Tips and Tricks
Tutorials
Sometimes it’s useful to be able to pass information between steps. For example, you might need to check that a client’s details that were entered into a registration form appear correctly on a confirmation page later on.
You could do this by storing the values in local variables, as illustrated in the following example:
The problem with this approach is that it tends to clutter up the steps, and it also leaks implementation details into the high-level tests. Another approach is to use the Thucydides test session, which is essentially a hash map allowing you to store variables for the duration of a single test. You can obtain this session map using the Thucydides.getCurrentSession() static method.
In the following example, we store the publication name and date, obtained from the current web page, in the test session.
Fill in your details below or click an icon to log in:
You are commenting using your WordPress.com account. ( Log Out / Change )
You are commenting using your Twitter account. ( Log Out / Change )
You are commenting using your Facebook account. ( Log Out / Change )
You are commenting using your Google+ account. ( Log Out / Change )
Connecting to %s
Notify me of new comments via email.
Note: HTML is allowed. Your email address will never be published.
Subscribe to comments
Search
Blogroll Official Selenium Blog Thucydides on Github Thucydides User Manual Thucydides User Manual (Single Page) Wakaleo Consulting – The Thucydides Company
Official Selenium Blog
Thucydides User Manual
Thucydides User Manual (Single Page)
Wakaleo Consulting – The Thucydides Company
Archives July 2015 (1) May 2015 (1) April 2015 (1) March 2015 (2) August 2014 (1) July 2014 (3) March 2014 (1) December 2013 (1) May 2013 (1) March 2013 (2) February 2013 (2) January 2013 (4) December 2012 (1) November 2012 (2) October 2012 (1) August 2012 (1) July 2012 (1) June 2012 (2) May 2012 (3) February 2012 (2) December 2011 (2) November 2011 (1) October 2011 (5) September 2011 (7)
July 2015 (1)
May 2015 (1)
April 2015 (1)
March 2015 (2)
August 2014 (1)
July 2014 (3)
March 2014 (1)
December 2013 (1)
May 2013 (1)
March 2013 (2)
February 2013 (2)
January 2013 (4)
December 2012 (1)
November 2012 (2)
October 2012 (1)
August 2012 (1)
July 2012 (1)
June 2012 (2)
May 2012 (3)
February 2012 (2)
December 2011 (2)
November 2011 (1)
October 2011 (5)
September 2011 (7)
ATDD batch-strategy BDD data-driven easyb example-driven firefox fluent FluentLenium HtmlTable Java jbehave jenkins jira JUnit page objects parallel testing proxy support release release tags reporting reports requirements Safari screenshots screeshots selenium spring tags testing Thucydides webelementfacade
Follow Blog via Email Enter your email address to follow this blog and receive notifications of new posts by email.
Enter your email address to follow this blog and receive notifications of new posts by email.
About This is the official blog for the Thucydides automated acceptance testing library. It contains news and updates about Thucydides releases, as well as tips, tricks and tutorials on how to use Thucydides to improve your WebDriver-based web tests, and links to related material.
Pages Introducing Thucydides Thucydides on Github Thucydides on Java.net
Create a free website or blog at WordPress.com.
The Traction Theme .
Get every new post delivered to your Inbox.
Join 3,120 other followers