• Solving Pop-up Dialog Issue – Katalon Studio | Software Testing Material

    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.

    Alert box Katalon Studio

    • Custom modal dialog: A modal dialog is a dialog box/pop-up window that is displayed on top of the current page.

    Custom modal dialog

    • Native Window dialog. This dialog is common in case of testing uploading files

    Native Window dialog

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

    To handle such pop-ups as described, you need to capture them first using the Object Spy feature in Katalon Studio. After that, you use “Switch To…” keywords of Katalon 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.

    Solving Pop-up dialog issue


    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:


    Keyword Description
    Switch To Default Content Switch back to the default window, after working with iFrame windows.

    To deal with Windows’ native dialogs such as uploading files, users use the 
    Upload File keyword. For example:


    Keyword Description
    Upload File Specify the file for the upload dialog.

    Regarding the browser’s popups as mentioned above, you can modify Desired Capabilities of the browser to prevent them from displaying. You can refer to this ticket for an example on how to disable the Chrome password manager.


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

    Here is the link “Katalon Studio Complete Tutorial

    Sharing is caring.

    Share on facebook
    Share on twitter
    Share on linkedin

    Like This Post?

    We have a lot more where that came from?

    We only send really good stuff occasionally, promise.

    Rajkumar SM

    Leave a Comment

    Your email address will not be published. Required fields are marked *

    Share on facebook
    Share on google
    Share on twitter
    Share on linkedin
    Share on whatsapp

    Recent Posts:

    Scroll to Top
    API Testing eBook