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

  • SEARCH
  • Home
  • 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 6371685
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 25, 20262026-05-25T01:06:47+00:00 2026-05-25T01:06:47+00:00

I have an web application, which generates a JS message ‘Are you sure you

  • 0

I have an web application, which generates a JS message
‘Are you sure you want to navigate away from this page?’ when you try to open a new page.
I know I can handle this message by

Selenium.getAlert();

(or some modification of it, I haven’t tried it yet)

But my main problem is that this message generates only when I leave this page.
In selenium I can leave page by using

Selenium.open("new address");

or

Selenium.back();

So I use code like this

Selenium.open("new address");
Selenium.getAlert();

But the problem is that Selenium.open doesn’t finish and go to next code line in program until the new page is fully loaded, but the page can’t be loaded until program goes to next code line and handles this alert. So it’s ablocked situation and I don’t know how to handle it.

  • 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-25T01:06:48+00:00Added an answer on May 25, 2026 at 1:06 am

    I don’t think it can be done, staying entirely within the Selenium RC API. I have cases similar to this that I handle by launching an AutoIt script, before the open(), that waits for the prompt and answers it. That only works on Windows, but if you need something for other systems, I’m sure there are equivalent tools.

    Selenium has always had a problem with alerts and confirmations (which this is – a confirmation has an OK/Cancel choice) that occur duing page loading. There’s even an ancient bug number enshrined in one of the error messages that explains that it can’t catch them.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a small C# ASP.NET web application which generates several PNG image files
I have a C# web application which generates SVG code using RaphaelJS , which
We have an ASP.NET web forms application which occasionally generates a validation error like
I have a j2ee web application which uses log4j for logging. I want to
I have web application which we deployed in a production . We have separate
I have a web application which provides Excel files via IE 7. It requests
I have a web application which contains both secure (SSL) and non-secure pages. A
Using JDeveloper as my IDE, I have a web application which calls services provided
I have a PHP web application which uses a MySQL database for object tagging,
I have a web-based application which is very highly reliant on jquery / javascript,

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.