Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3792006
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T12:33:22+00:00 2026-05-19T12:33:22+00:00

I am having a code like the following selenium.chooseCancelOnNextConfirmation() ; selenium.click(deleteRequest); // confirm dialog

  • 0

I am having a code like the following

selenium.chooseCancelOnNextConfirmation();

selenium.click(“deleteRequest”);// confirm dialog will be displayed on clicking the button

System.out.println(“is confirmation present “+selenium.isConfirmationPresent());

Eventhough i am using selenium.chooseCancelOnNextConfirmation(), please let me know why selenium.isConfirmationPresent() returns true.

But selenium.isConfirmationPresent() returns false after

selenium.getConfirmation();

Is it mandatory to use selenium.getConfirmation(), as i am not able to do further processing. It says

com.thoughtworks.selenium.SeleniumException: ERROR: There was an unexpected Confirmation! [Are you sure to delete selected request(s)?]
com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:97)
at com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:9

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T12:33:23+00:00Added an answer on May 19, 2026 at 12:33 pm

    This is the expected behaviour. chooseCancelOnNextConfirmation() dictates the behaviour of getConfirmation(). Calling getConfirmation() effectively “consumes” the confirmation popup. You must use getConfirmation or verifyConfirmation before continuing your test, as any other Selenium command will fail if you do not handle the popup with a getConfirmation call.

    By default, the confirm function will
    return true, having the same effect as
    manually clicking OK. This can be
    changed by prior execution of the
    chooseCancelOnNextConfirmation
    command. If an confirmation is
    generated but you do not get/verify
    it, the next Selenium action will
    fail.

    So your code could be:

    selenium.chooseCancelOnNextConfirmation();
    
    selenium.click("deleteRequest")
    
    selenium.getConfirmation();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Would having a nice little feature that makes it quicker to write code like
I'm writing some JavaScript code to parse user-entered functions (for spreadsheet-like functionality). Having parsed
I'm having an issue with the following code: private void DataPortal_Fetch(TaskCriteria criteria) { using
I'm having some problems with the following code: private class ClientPluginLoader : MarshalByRefObject {
I have a section of code like the following: ---- file.php ---- require_once(mylib.php); function($a,$b)
I have a piece of Perl code somewhat like the following (strongly simplified): There
I am having trouble doing something simple like the following using (SPSite site =
I have some simple code like: $('#modal-buttons [href*=close]').bind('click.modalClose',function(){ app().modal('close') }); But let's say I
I stumbled across the following warning when I was reading Code Like a Pythonista:
Wondering if it's possible to do something like the following (I know the code

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.