Loading...

Define test and variables

In this chapter, we’ll first define the steps of the data-driven test. Then, we’ll define the required variables for this scenario. You’ll also find out how to manage variables in akaAT Studio.

Variables are one of the key parts of data-driven testing. They are the placeholders for values you want to feed your test, either from data sources or parameters.

1. Define action variables

Action variables replace a constant value in a component or property of an action, e.g. the specific text string in a Key sequence action. Action variables are limited to the recording module they’re defined in.

First, we’ll replace the constant text values in the respective actions for entering message and account in the demo test cases.

 

To replace a constant value with a variable:

  1. Name the variable so you can easily identify and  click OK.
  2. Open the drop-down list for the constant value you want to get output and click to choose variable you want.
  3. The variable appears in the action table.

2. Define global variables

Define a Global Variable

A Global Variable in akaAT Studio is a variable which is used globally in the project. For example, if you are going to define a variable as a Global Variable, you can use it in any test case in the project.

  1. Right click on Global Variable, then click Open.
  2. In the New Variable dialog box, specify details for the variable then click  OK.
  3. The variable is added to the test case accordingly.

Use a Global Variable

Any test case across a project can use global Variables (e.g., input data for keywords in Manual View or params when binding Data for Test Execution).

Example #1: Create Test Case using Test Data

 

  • Step 1: Creating a Test Data called “DemoTestData” by right click to Test Data, click New >> Test Data.

  • Step 2: Creating a test case with the variable called from test data table by right click Test Case >> New >> Normal Test Case.

    We create variable “account” on the tab “Variable” by clicking button “Add variable”, on the field Variable name, enter “account” and choose “Data Table” in the field Type.

  • Step 3: To login the form, we need to input username and password, here we get data from data table to transfer to test case. Using “For loop” to fill outs the login form with lots of accounts. For the first strep, we choose “For statement” at Control, at Data Input, fill out Source “variable” >> Value “account”.

  • Step 4: Click “Insert Step” to Open browser with the global variable created at the above.

  • Step 5,6: We set text to input username and password with the data input from data table. Choosing source is Data Column instead of  Default. Data input equals to “variable name”.”column name”, here we have  account.Username and account.Password.

  • Step 7, 8, 9: Click to submit button with Xpath. Then verifying the element flash message success is visible with time outs equals to 3 second and close browser.

Example #2: Create Test Suite using Data Binding

Scenario: Using Test Suite to run test data through Data Binding.

  • Step 1: Creating a test case with the variable called from test data table by right click Test Case >> New >> Normal Test Case.

We create two variables “username” and “password” on the tab “Variable” by clicking button “Add variable”, on the field Variable name, enter “username”, “password” and choose “String” in the field Type.

  • Step 2: Create a test suite by right click on Test Suites >> choose New >> Test Suite.

 

After creating a new test suite, here named “Demo Test Suite”, we learn some information of test suite’s interface.

-  Button “Add test case”: to add a new test case to test suite. A new window is opened to choose test case. You can add more test cases to test suite and save time by running at “Concurrent Instance”.

-  A checkbox to define running of this test case.

-  Choosing a suitable test data at Data File with an open-up window.

  • Step 3: After adding a proper test case, we use data binding to run test suite with data table. An open-up window with two variables of test case is appeared, we choose “Data Table” at Variable Type, “Test Data” at  Source, and column name accordingly at  Value (here we use table DemoTestData, the column name is Username and Password in turn).

  • Step 4: At tab “Test Data”, click the data checkbox to use the data that you want to run in test suite. Then click OK to save.

  • Step 5: Run Test Suite by clicking icon run on the top left corner.

Blog Posts

Image

Getting Started

Go to akaAT Download page to get the latest version of akaAT Studio. A suitable version for your system will be automatically detected and recommended for download...

Continue Reading...

Image

Define Test and Variables

In this chapter, we’ll first define the steps of the data-driven test. Then, we’ll define the required variables for this scenario. You’ll also find out how to manage variables in akaAT Studio...

Continue Reading...

Image

Multi-touch Actions in Mobile App

Multi-touch action often appears in gaming applications. This tutorial shows you how to perform a multi-touch action...

Continue Reading...

Image

Web Handling

What are Locators?
Locators are basically the HTML attributes of a web element. They help identify unique web elements on a page and command testing frameworks...

Continue Reading...

Image

Pop-up Handling

When performing automation testing, you may sometimes deal with pop-up dialog issue that needs to be handled differently from normal test objects. This tutorial shows you how to deal with pop-up controls....

Continue Reading...

Image

Alert Handling

What is an alert?
An alert is a JavaScript function which is used to notify users on a Web page. It displays a dialog with a specified message and OK/Cancel buttons...

Continue Reading...

Image

Textbox Handling

This tutorial illustrates how to handle Textbox, Checkbox, Radio buttons using akaAT Studio. The reference source code is provided at the end of the tutorial...

Continue Reading...

Image

iFrame Issue Handling

A very common type of control used in website is the HTML iframe. And this control needs to be handled in a specific manner when testing. This article shows you how to handle iframes...

Continue Reading...

Image

Dropdown Handling

A drop-down list (abbreviated drop-down; also known as a drop-down menu) is a graphical control element, similar to a list box, that allows the user to choose one value from a list...

Continue Reading...

Image

Static and Dynamic Test Objects Handling.

Test Objects are one of the most crucial parts of building a successful automation project. Some of them are static (do not change at all) and some of them are dynamic (they are dependent on some dynamically changing parameters)...

Continue Reading...