title: Selenium Webdriver: how do respond on a prompt
body: <p>I try to set up a test for a webpage using Selenium WebDriver and Python. Therefore I start the Docker image <em>selenium/standalone-firefox</em>.</p>
  
  <p>Within this test normally a JavaScript written prompt pops up and want to receive an entry prior I can click OK.</p>
  
  <p>But how can I interact with this prompt and the OK button?</p>
  
  <p>On Selenium IDE the recorder uses <code>answer on next prompt</code> for that. How to do this with Python-Selenium? If Python does not support an corresponding command, how do I get the needed information to do the same with the available commands?</p>
  
  <p><a href="https://i.stack.imgur.com/Ko8ER.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Ko8ER.png" alt="enter image description here"></a></p>
  
  <pre><code>from selenium import webdriver
  from selenium.common.exceptions import TimeoutException
  from selenium.webdriver.support.ui import WebDriverWait # available since 2.4.0
  from selenium.webdriver.support import expected_conditions as EC # available since 2.26.0
  
  from selenium.webdriver.firefox.options import Options
  
  # connect to docker Selenium Server
  options = Options()
  driver = webdriver.Remote(
     command_executor='http://localhost:4444/wd/hub',
     desired_capabilities=options.to_capabilities()
  )
  
  driver.get("https://www.ecalc.ch/motorcalc.php?hacker&amp;lang=en&amp;weight=4500&amp;calc=auw&amp;motornumber=1&amp;warea=60&amp;elevation=300&amp;airtemp=25&amp;motor=hacker&amp;type=2|a60-7xs_v4_28-pole&amp;gear=1&amp;propeller=apc_electric&amp;diameter=18&amp;pitch=10.0&amp;blades=2&amp;batteries=topfuel_light_4500mah_-_30/45c&amp;s=8&amp;esc=master_spin_160_pro&amp;cooling=good")
  
  print(driver.title)
  
  driver.find_element_by_id("modalConfirmOk").click()
  
  driver.find_element_by_name("btnCalculate").click()
  
  driver.find_element_by_id("AddCSV").click()
  
  ????
  </code></pre>