Loading...

How to handle Drop-down menu

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. When a drop-down list is inactive, it displays a single value. When activated, it displays a list of values, from which the user may select one. When the user selects a new value, the control reverts to its inactive state, displaying the selected value. It is often used in the design of graphical user interfaces, including web design.

This tutorial illustrates how to handle the drop-down list using akaAT Studio built-in keywords.

The below image shows what the sample select command has.

  1. Index:The index of the option to be selected/deselected.
  2. Value:The value of the "value" attribute.
  3. Label:The exactly displayed text of a particular option

 akaAT Studio provides keywords to select option by Index, Value and Label. 

Example 1: Here in this example, we are Validating verify Option Selected By Index, Value and Label.

Step 1. Create a akaAT project with the name HandleDropdownMenuSample

Step 2 Get location of elements

Because the website uses iframe, so we have to get location of iframe

Do all steps as the instruction below to get iFrame location

Let do the similar actions to get other elements locator

  • select_CarOption: id : cars

Step 3: Create test case

Example 1: Create test case with the name ‘OptionSelectedByIndexSample’, open it and write step by step base on image below:

Example 2: Create test case with the name ‘OptionSelectedByValueSample’, open it and write step by step base on image below :

Example 3: Create test case with the name ‘OptionSelectedByLabelSample’, open it and write step by step base on image below:

Note: Because the website uses iframe, so we should to Switch To Frame in step 2 before interact with the element.

In addition, akaAT also provides other keywords dedicated to handle select tag. You can use the following options to address the situation: 

Example 4:

We have a multi-select drop down as the following, values in a multi-select include district of USA. This drop-down allows users to select multiple items.

The script below shows the use some keyword in keyword column in the above table to deliberately handle drop-down list.

Step 1. Create a akaAT project with the name HandleDropdownMenuSample

Step 2 Get location of elements

  • select_Address: //select[contains(@class, 'example-basic-multiple')]

Step 3: Create test case with the name ‘MultipleSelectSample’, open it and write step by step base on image below:

 

 

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...