Loading...

Solving Pop-up dialog issue with akaAT Studio

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.

What is a pop-up?

A pop-up is a graphical display area, usually in a form of a small window that appears ("pop-up") in the foreground of the current interface.

What are issues with pop-up?

The problem with pop-ups is that they usually show up unexpectedly. There is no certain way to overcome this except that you need to understand the behavior of the application and insert scripts accordingly to handle the situation. Another issue with pop-ups is that they are not from the AUT so you need to handle them with dedicated keywords.

Below are a few commonly used pop-ups which might cause problems in your test web automation:

  • New browser window.
  • Alert: An alert box is often used to make sure that information comes through to the user.
  • Custom modal dialog: A modal dialog is a dialog box/pop-up window that is displayed on top of the current page.
  • Native Window dialog. This dialog is common in case of testing uploading files

A suggested solution for handling pop-ups using akaAT Studio:

To handle such pop-ups as described, you need to capture them first using the Object Spy feature in akaAT Studio. After that, you use "Switch To…" keywords of akaAT Studio to set focus to the specified pop-up as needed.

The following screenshot shows simple scripts on how to handle a pop-up using the Switch To Window Title keyword.

  • Step 1: Launching the browser navigating to page by Open Browser method
  • Step 2: Clicking on button “Click” with Xpath below:
  • Step 3: Using “Switch To Window Title” to switch another window with title equals to “New Window”

 

  • Step 4, 5: Get text of heading in a new window and verify equal it.

 

Where:

Keyword

Description

Switch To Window Title

Switch to the window identified by a given title.

Switch To Window Index

Switch to the window identified by a given index.

Switch To Window Url

Switch to the window identified by a given URL.

If you want to switch back to the default window (parent), use the Switch To Default Content keyword. For example:

Where:

Keyword

Description

Switch To Default Content

Switch back to the default window, after working with iFrame windows.

Example

Here in this example, When I clicked a link, it will open a new window. So I want to switch to that window to perform actions on the newly opened window. We can handle it using akaAT Studio built-in keywords as shown below.

Switch to Window Index:

We need to use it when you want to switch to the second window (index 1).

Manual Mode:

The same step with Switch to Window Title, however, we replace using Switch to Window Index below:

Switch To Window Url :

Switch to the window with given URL.

Manual Mode:

That is some examples of how we handle window using akaAT Studio. You can download the source code  here.

Exception

Noted that NoSuchWindowException exception will be thrown when window target to be switched doesn't exist.

 

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