Nasdanika WebTest - Modular functional testing of Web and Mobile Applications
Nasdanika WebTest is a modular framework for automated functional/acceptance testing built on Selenium WebDriver, JUnit and OSGi. The framework implicitly takes screenshots during test execution and generates HTML report with slide shows demonstrating UI flows. Nasdanika WebTest addresses browser/device variability by abstracting tests from UI implementation details with Actor and Page classes, and separating Actor and Page specifications (interfaces) and implementations.
Published on: Mar 3, 2016
Transcripts - Nasdanika WebTest - Modular functional testing of Web and Mobile Applications
Modular functional testing
of Web and Mobile Applications
2014 Selenium Web Driver * JUnit * OSGi
Functional testing framework built on
Implicit screenshot capturing
Report generation with screenshots organized
Actor and page classes to facilitate reuse and
address device/browser variability
Summary, Test Coverage
Page Class Details
Test Class Details
Test Method Details
Opens by clicking on a screenshot in the carousel
How It Works
Test Case – A JUnit 4 test case class implementing WebTest interface.
Test Method – A JUnit test method. Uses Actor and Page specifications.
Page Specification – An interface abstracting test/actor code from the details of UI
Actor Specification – An interface abstracting tests from how a particular UI flow is
Page Implementation – An implementation of the Page Specification for a particular UI.
Actor Implementation – An implementation of the Actor Specification for a particular UI.
Page Factory – A factory interface for creating pages.
Actor Factory – A factory interface for creating actors.
Page Factory Implementation – An implementation of the page factory interface.
Actor Factory – An implementation of the actor factory interface.
Annotations (partial list)
Wait – Applies to test/actor/page methods and page classes to wait for certain
conditions (e.g. visibility of an element) before executing method or initializing
Waits –Composite Wait – a collection of Wait annotations connected by AND.
Screenshot – Configures when to take a screenshot and allows to specify delay.
ActorFactory – A field annotation for injecting actor factory OSGi service into a
PageFactory – A field annotation for injecting page factory OSGi service into a
Pending –Test methods with this annotation are not executed, but included into
the report. Can be used if a test is implemented before actors and pages it uses.
Tests depend on actor/page specifications
Actor implementations depend on page specifications
Implementations are provided as OSGi services
«@ActorFactory annotated field»
+ actorFactory :ActorFactory
Actor Implementation Bundle
Page Implementation Bundle
+ createPage() :Page
«JUnit T est»
+ createActor() :Actor
+ createPage() :Page
Factory injection into annotated fields
+ createActor() :Actor
Runtime Assembly by OSGi Declarative Services
The framework finds actor/page factory OSGi service
The framework creates a proxy to intercept method invocations
The framework injects the proxy into the test class
Test method execution
The framework takes a screenshot before and after method invocation (configurable)
Test code uses the injected factory to create actors and/or pages
The factory proxy creates proxies for actors and pages and returns them to the test
When test code invokes actor/page proxies’ methods they
Honor @Wait and @Waits annotations if any
Invoke the corresponding actor/page method
Take screenshots before and after actor/page method execution
Duplicate screenshots are eliminated
Screenshots are organized into slide shows
Test/actor/page method calls are organized into a tree
Page Factory is injected by OSGi
Test Class (fragment)
Factory is injected by the framework
Suppressing BEFORE screenshot (blank page)
Parameterized Test (fragment)
Set up workspace(s)
Install NasdanikaWorkspaceWizard from
Install Maven Integration For Eclipse from the Eclipse Marketplace
Generate workspace projects – all in one workspace, or several
workspaces, e.g. UI driver workspace and Tests project workspace
Tests – use with different actor/page implementations.
Actors/pages – use in different tests.
Some functionality (e.g. Log-in or Sign-up tests) can be extracted
into shared libraries and reused between applications – facilitates
consistent user experience across applications.
Separation of concerns and duties
Analysts/Designers – define tests and Actor/Page specifications.
Test developers – implement tests and actor classes.
Application developers – implement page classes.
Screenshots allow visual inspection by a wide community
Test reports can be used as a training and documentation
resource which is always up to date.
Wiki - https://github.com/Nasdanika/server/wiki/webtest
Example of UI driver - https://github.com/Nasdanika/examples-bank-ui-driver
Test application -
Sample report - http://www.nasdanika.org/examples/test-report/#
P2 repository - http://www.nasdanika.org/repository