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 8047187
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T06:01:19+00:00 2026-06-05T06:01:19+00:00

I’m fairly new at Python/JS and also automated testing with Selenium/WebDriver, but I have

  • 0

I’m fairly new at Python/JS and also automated testing with Selenium/WebDriver, but I have made some progress!

Now I’m stuck at one point and it’s really frustrating.

The website I am testing sells products. I managed to make my script navigate randomly and get to the payment page, fill in dummy data, submit data by using:

browser.execute_script("document.Form.submit(); return true;")
browser.execute_script("processPayment(); return true;")

Usually, there is a Pay now button and clicking that element results in the same exception and there was no way for me to click OK/Cancel on it via WebDriver (no WebElement), but I figured out that executing this JS code I can get past it. My newly loaded page (after submitting data and confirming the posting of it) with a confirmation and all correct data loads, but the Python script is interrupted and I can’t continue the test.

Is there a workaround for this? What I want it to do is to ignore that modal dialog, wait for the next confirmation page to load and then continue locating elements, printing their values, storing them etc.

Tried using:

wait = ui.WebDriverWait(browser,10)
wait.until(lambda browser: browser.title.lower().startswith('Your Receipt'))
print(browser.title)

but the script gets interrupted. Sorry if this has been answered, but I couldn’t find it, and also I am a newbie!

Thanks in advance!

EDIT:

Did it! In my case what worked is I just modified my code a little

browser.execute_script("document.roomBookingForm.submit(); return true;")
alert = browser.switch_to_alert()
alert.dismiss()
browser.execute_script("processPayment(); return true;")

Note for newbies that you will need to import Alert.

from selenium.webdriver.common.alert import Alert
  • 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-06-05T06:01:21+00:00Added an answer on June 5, 2026 at 6:01 am

    Note for newbies (like me) that you will need to import Alert.

    from selenium.webdriver.common.alert import Alert
    
    ... ... ... (code placeholder)
    
    browser.execute_script("document.roomBookingForm.submit(); return true;")
    alert = browser.switch_to_alert()
    alert.dismiss()
    browser.execute_script("processPayment(); return true;")
    

    just added the alert handler

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

Sidebar

Related Questions

I have just tried to save a simple *.rtf file with some websites and
I have a jquery bug and I've been looking for hours now, I can't
I have a string like this: La Torre Eiffel paragonata all’Everest What PHP function
this is what i have right now Drawing an RSS feed into the php,
I have a French site that I want to parse, but am running into
I have some data like this: 1 2 3 4 5 9 2 6
link Im having trouble converting the html entites into html characters, (&# 8217;) i
I want to count how many characters a certain string has in PHP, but
For some reason, after submitting a string like this Jack’s Spindle from a text
I have this code to decode numeric html entities to the UTF8 equivalent character.

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.