How to handle POP up

  1. there is web automation and POP up is coming randomly how we can handle
  2. if india is there in web page we need to click on web page else nothing

how we can handle above to scenario

@babita

  1. Use the “Attach Browser” activity to indicate the web page you want to automate. Indicate the web page by indicating the browser window or by providing the URL.
  2. Inside the “Attach Browser” activity, use the “Element Exists” activity to check if the pop-up exists on the web page. Set the “Selector” property of the “Element Exists” activity to identify the pop-up element.
  3. Connect the output of the “Element Exists” activity to an “If” activity. The condition should be the output of the “Element Exists” activity.
  4. Inside the “If” activity, use the “Get Text” activity to retrieve the text content of the web page. Set the “Selector” property of the “Get Text” activity to identify the element containing the text.
  5. Connect the output of the “Get Text” activity to a “String Contains” activity. Set the input strings as the output of the “Get Text” activity and the desired text to search for (e.g., “India”).
  6. Connect the output of the “String Contains” activity to a second “If” activity. The condition should be the output of the “String Contains” activity.
  7. Inside the second “If” activity, place the activities that need to be executed when the text “India” is found on the web page (e.g., clicking a specific element). You can use the appropriate activities such as “Click,” “Type Into,” or others depending on the specific action you need to perform.

do you have any workflow using same activity. If you have please share.

@babita In modern you can use check up state activity as well.

Hi @babita

Use the check app state activity for this. Indicate the Ui element on India. If the India is appears then give the click activity in target appears block. If India is no there then go forward with another activity in target does not appear block.
Use the same check app state activity to handle the popup also
Check the below image for better understanding.

Note - Use the check app state activity with in the Use application\browser activity, because these are the modern activities.

Hope it helps!!

Hi @babita

  • If the pop-up is expected and occurs frequently, you can handle it with the “Element Exists” activity to check if the pop-up exists before proceeding with further actions. Use a conditional statement to handle different scenarios based on the presence or absence of the pop-up.
  • If the pop-up is unexpected or appears rarely, you can use the “On Element Appear” or “On Image Appear” activities to detect the pop-up and then perform the necessary actions.

I hope it helps!!

@babita

If it is randomly coming any where after any step

Then you have two options …

  1. Use parallel activity with one side to click on the pop up and other side all the activities you do
  2. Use a global exception handler and give click on pop up there and then resume the flow

Cheers

This topic was automatically closed 3 days after the last reply. New replies are no longer allowed.