0

In our application, when I navigate between web pages, system is showing attached Browser Confirmation Alert. I am using Robot framework to automate. I tried accepting or Dismissing the alert using 'Handle Alert' keyword. But i am observing 'Alert not found' error in report. Also right click is disabled to find web element in the Alert window.

*** Settings ***
Library           Selenium2Library
Test Teardown    Close Application

*** Variables ***

*** Test Cases ***
Dismiss Alert
    Open Aplication
    Click WebElement    ${serchXpath}
    Click WebElement    ${navigateXpath}
    Wait Until Element Is Visible    ${Inv_xpath_all_rows}    timeout=60 seconds
    Handle Alert    action=DISMISS    timeout=60 s

Fails with : Alert not found in 5 seconds. at the line Handle Alert action=DISMISS timeout=60 s

I am new to Automation world, Request you to help me. Thanks a lot.

Madhu
  • 65
  • 1
  • 1
  • 9

1 Answers1

0

Looking at the screenshot of the popup attached, it looks like you are dealing with an "External Protocol Request" box. You cannot interact with this box using selenium webdriver API. Instead you need to handle this using ChromeOptions or by editing the Chrome profile. Here is a SO answer that describes how to go about it. To handle the same in RobotFramework using Selenium2Library, check this out.

${chromeOptions}=    Evaluate    sys.modules['selenium.webdriver'].ChromeOptions()    sys, selenium.webdriver
${exclude}=    Create Dictionary    "fasp"=True
${prefs}=    Create Dictionary    protocol_handler.excluded_schemes=${exclude}
Call Method    ${chromeOptions}    add_experimental_option    prefs    ${prefs}
Create Webdriver    Chrome    chrome_options=${chromeOptions}

Source: https://support.asperasoft.com/hc/en-us/articles/216660968-How-to-unblock-the-launching-of-Connect-3-6-5-in-Chrome

GPT14
  • 809
  • 6
  • 13
  • I tried with above examples, I am still facing same error. It seems to me that Robot is unable to identify the alert. Thank you GPT14 for the response. – Madhu May 29 '18 at 03:37
  • @Madhu: I have edited my answer based on your popup screenshot. – GPT14 May 29 '18 at 05:06