com
Automation Framework
The Software Testing Automation Framework (STAF) is an open source project
that enables users to create cross-platform, distributed software test environments.
The project is licensed using the Common Public License (CPL). STAF includes a
number of services that provide specific functionality. The most prominent of these is
the test execution engine called STAX. Other services provide cron, file system,
inter-process communication, e-mail, and HTML support, among others.
STAF was originally developed for internal use by IBM in the 1990's. IBM supports
users of STAF through extensive online documentation and user forums.
Keyword-driven Testing
Keyword driven testing is a software testing technique that separates much of the
programming work of test automation from the actual test design. This allows tests
to be developed earlier and makes the tests easier to maintain. Some key concepts
in keyword driven testing include:
Contents:
Overview
Base Requirements
The Framework
Methodology
Vision for Automation
Success Factors for Automation
How to Measure Success
Conclusion
Overview
Keyword-driven testing or Table-driven testing is a Software testing
methodology as part of the Test automation discipline that separates the
programming work from the actual Test script so that the test scripts can be
developed without knowledge of programming. As a result the test scripts can be
maintained with only minor updates, even when the application or testing requires
significant changes.
Base Requirements
There are numerous requirements that consider to be "base requirements" for
success with keyword driven testing. These include:
The Framework
The implementation of this methodology is framework dependent. This framework
requires the development of data tables and keywords, independent of the test
automation tool used to execute them and the test script code that "drives" the
application-under-test and the data. In a keyword-driven test, the functionality of
the application-under-test is documented in a table as well as in step-by-step
instructions for each test.
If we were to map out the actions we perform with the mouse when we test our
Windows Calculator functions by hand, we could create the following table. The
"Window" column contains the name of the application window where we're
performing the mouse action .
Methodology
The keyword-driven testing methodology divides test creation into two stages:
• Planning Stage
Analyzing the application and determining which objects and operations are
used by the set of business processes that need to be tested.
Determining which operations require customized keywords to provide
additional functionality, to achieve business-level clarity, and/or to maximize
efficiency and maintainability.
• Implementation Stage
Although this methodology requires more planning and a longer initial time-
investment than going directly to the test creation stage and recording your steps,
this methodology makes the test creation and test maintenance stages more efficient
and keeps the structure of individual tests more readable and easier to modify.
Test Design
Test design is more important than the automation technology. Design is the most
underestimated part of testing. It is my belief that test design, not automation or a
tool, is the single most important factor for automation success. To understand more
about test design see these previous articles:
The "right" team must also be assembled. This team should include:
For the team there should be a clear division of tasks and responsibilities as well as
well defined processes for decision making and communication.
Progress
You should measure test development against the test development plan. If goals
are not reached, act quickly to find the problems. Is the subject matter clear? Are
stake holders providing enough input? Is it clear what to test (overall, per module)?
Is the team right (enough, right skill set mix)?
You should measure automation and look at things such as implemented keywords
(actions) and interface definitions (defined interface dialogs, pages, etc).
You should measure test execution looking at things such as how many modules are
executed and how many executed correctly (without errors)?
Quality
Conclusion
It is important to understand that keywords are not magic, but they can serve you
well. What is more important is to take the effort seriously and "do it right". Doing it
right means that test design is essential, both global test design and the design of
individual test cases. Automation should be done but it should not dominate the
process. Automation should flow from the overall strategy, methodology, and
architecture. It is also very important to pay attention to organization – the process,
team, and project environment.
Data-driven Testing
Automated tests play back a recorded (or programmed) sequence of user actions
that cover a certain area of the tested application. To get larger coverage, you can
perform tests with different input data. Suppose, for example, you test an input form
of an application. After you have recorded a script, it contains only values that you
entered during the recording. Most likely, data you have specified does not cause
errors in the application, but other data may cause them. Data-driven testing allows
you to test the form with a different set of input values to be sure that the
application works as expected.
Contents:
Introduction
Data Driven Automation Frameworks
Data Driven Scripts
TestComplete's Support for Data-Driven Testing
Introduction
Data-driven testing means that scripts read data from an external storage site, for
example, from a file or database, rather than use values hard-coded in the script.
Such a separation makes tests logically simpler. A script containing several sets of
hard-coded values can be rather difficult to modify. For instance, if you need more
input data, you will have to modify the script code.
Normally, the storages hold both input and verifying data. A data-driven test
includes the following operations performed in a loop:
TestComplete includes a number of features to perform these steps. You can select
the functionality that best suits your needs.
Operations
Following are the operations of Data-driven Testing:
It is convenient to keep data for tests in special storages that support sequential
access to a set of data, for example, script arrays, text files, database tables, Excel
sheets, and so on. You can access data in these storages using scripting objects
provided by TestComplete. To make the access even easier, TestComplete includes
special features for extracting data from CSV (comma-separated values) files,
database tables and Excel sheets.
To enter data into application forms and controls, you can either simulate
keystrokes, or store data to a property of the desired form or control. The way you
simulate the input depends on many factors. For example, it depends on whether
your application is compiled as an Open Application.
Verifying results
The easiest way to check whether your test actions were performed successfully is to
store the check value along with the set of input data and then compare the output
with these values. If the output is an image or a file, you can use TestComplete’s
features to compare the images or the files' and object properties.
Sometimes this manifesto is hard to explain to people who have not yet performed
significant test automation with these capture\replay tools. But it usually takes less
than a week, often less than a day, to hear the most repeated phrase: "It worked
when I recorded it, but now it fails when I play it back!"
This particular scenario of clicking on the image map might exist thousands of times
throughout all the scripts that test this application. The preceding example identifies
the image by the title given to the document and the index of the image on the
page. The hard coded image identification might work successfully all the way
through the production release of that version of the application. Consequently,
testers responsible for the automated test scripts may gain a false sense of security
and satisfaction with these results.
However, the next release cycle may find some or all of these scripts broken because
either the title of the document or the index of the image has changed. Sometimes,
with the right tools, this might not be too hard to fix. Sometimes, no matter what
tools, it will be frustratingly difficult.
Remember, we are potentially talking about thousands of broken lines of test script
code. And this is just one particular change. Where there is one, there will likely be
others.
Findings:
A test automation framework relying on data driven scripts is definitely the easiest
and quickest to implement if you have and keep the technical staff to maintain it. But
it is the hardest of the data driven approaches to maintain and perpetuate and very
often leads to long-term failure.
You can see that each element of this string is separated by a comma. Each
individual element of the string is a called a “field” or a “value”. The GetCSVCount
and GetCSVItem methods work with strings like this. If we passed this string in to
the GetCSVCount function, we’d get a return value of 10. There are ten discreet
values in this CSV string. In addition, if we wanted to the get the customer’s first
name, we could use GetCSVItem to do that.
So, with these two functions, we’re able to easily retrieve values from CSV files,
something that is quite useful if our external DDT data is in CSV text files or
spreadsheets. Returning again to our customer/orders example, we might see the
following. (This is pseudo-code only.)
function ReadExternalData(aFileName)
{
var lsLine
var lsCustomerName, lsAddr, lsCity, lsRegion, lsPostalCode
openFile(aFileName)
while not EOF(aFileName)
{
lsLine = readLine(aFileName)
if (GetCSVCount(lsLine) == 5
{
lsCustomerName = GetCSVItem(lsLine, 0)
lsAddr = GetCSVItem(lsLine, 1)
lsCity = GetCSVItem(lsLine, 2)
lsRegion = GetCSVItem(lsLine, 3)
lsPostalCode = GetCSVItem(lsLine, 4)
Don’t worry about trying to make this code actually work – it’s rather abstracted and
is for demonstration only, but your actual DDT code might be similar. What this small
amount of code does is very powerful and serves as a great example of a standard
DDT scenario.
As for the other three methods covered in the help (CallMethod, SetValue and
GetValue) I won’t talk about those now – they’re not necessary for this primer on
DDT.
The part of this whole process that’s not clearly covered is that of actually reading
the external data. That is in part because there are so many options. TestComplete
can read your DDT data from text files, spreadsheets, database tables or from
internal data arrays. To access your data, you can use ADO, OLE automation or
standard text file access methods. Many of these storage options and access
methods are shown in the DDT demo project included with TestComplete, which we’ll
cover shortly. For now, just plan on getting to your data whichever way is most
comfortable.
http://www.OneStopTesting.com
http://groups.yahoo.com/group/OneStopTesting/
http://www.CoolInterview.com
and
http://www.TestingInterviewQuestions.com
and
http://www.NewInterviewQuestions.com