Opkey logo

How to Handle Popup Windows With Opkey?

November 11, 2016
/
Iffat Ara Khanam

Quite a times in automation we face applications where an end-user flow is only completed by saying yes/ no in a pop-up window. Most of the open-source tools have complex programs; and insufficient documentation available to handle them. Also, we at times encounter situations where an unexpected pop up come and our automation run is hampered by it. The handling of both kinds of expected and unexpected pop-up windows are available in Opkey and that too with ease. In Opkey Personal Edition, for handling popup which sometimes occurs during the execution, we have two system keywords that can be used as per the need.

  • HandleExpectedPopup
  • RecoveryHandlePopup

HandleExpectedPopup:This system keyword has 3 Inputs:

  • WindowTitle: Specify the title of the window which is to be handled.
  • NumberOfTabs: Specify the number of times the Tab key will be pressed and at last Enter key will be pressed.
  • WaitTime:   Specify the duration with in which this system keyword will handle the specified popup.

How to Use:In a test case, we add a step from where we want to activate Popup Handling and select HandleExpectedPopup system keyword.

Working: Execution of the step of the test case which contains the HandleExpectedPopup system keyword will activate popup handling. After that, if any popup occurs having the same window title as specified in the input value of the system keyword and its waiting time is remaining then that system keyword will press the Tab key as per the specified number of times and then it will press an Enter key. After that, the execution will continue accordingly. This system keyword can be used for handling only one popup during the execution.

RecoveryHandlePopup: This system keyword has 2 Inputs:

  • WindowTitle: Specify the title of the window which is to be handled.
  • NumberofTabs: Specify the number of times the Tab key will be pressed and at last Enter key will be pressed.

How to Use:In a test case, we add a step from where we want to activate Popup Handling and select RecoveryHandlePopup system keyword.

 Working: Execution of the step of the test case which contains the RecoveryHandlePopup system keyword will activate popup handling. After that, if any popup occurs during the complete execution of the test suite having the same window title as specified in the input value of the system keyword that system keyword will press the Tab key as per the specified number of times and then it will press an Enter key. After that, the execution will continue accordingly. This system keyword can be used for handling all popups with specified window title during the complete execution of the test suite.

How to implement this Scenario in Opkey:

  • Create a test case having HandleExpectedPopup System keyword and RecoveryHandlePopup System keyword for handling popup as shown below:
creating test case

Specify the Input Values of these steps of the test case

21
22
  • When these steps will execute then while login in yahoo mail account a message will occur. This popup will be handled by the HandleExpectedPopup System keyword because its window title is the same as specified in the input values. Then the user will continue with their proceedings.
  • Each time Mozilla Firefox opens, it asks for making the browser as default browser if it is already not set, then to handle these kinds of message boxes we can use RecoveryPopupHandle System keyword because it will handle popup in the complete execution.
23
  • Further the normal execution will continues.
Portrait of a woman wearing a beige embroidered top.

Iffat Ara Khanam

Technical Content Lead

Iffat is the content lead at Opkey. She has expertise in writing technical content focused around ERP testing, Cloud apps, automation and other IT related topics. She has rich experience in writing content for marketing collateral like whitepapers, case studies, newsletters etc. which helps in funnel creation for sales.

On Demand Webinar
Designing the AI-Augmented Workforce: The Next Era of HCM
Dec 10, 2025 9:00am EST
Register Now
Grae Gray
EVP - ERP Innovation & Excellence, Opkey
Ram Subramanian
EVP, Enterprise Solutions at Opkey

Get started with No-Code test automation today

Featured Content

Risk Management and Quality Assurance
Post

Risk Management and Quality Assurance 

Quality and Risk Management (QRM) are two sides of the same coin—each reinforcing the other to ensure reliable, high-performing enterprise systems. Quality assurance builds the foundation for stability, compliance, and…

Discover what Opkey can do for you.