WebDriverException in dismiss_alert()

Asked by Jeff Kunce

New to SST, so this could be operator error. I'm getting a WebDriverException when I do a dismiss_alert() or accept_alert(). If I wrap the dismiss_alert() in a try/except, the alert is dismissed and the test runs fine.

HTML fragment:
  <input type="button" id="aaa_button" value="click"
      onclick="alert('aaa button pressed'); return false;"

SST fragment:
  click_element('aaa_button', wait=False)

Traceback is below.

I'd be glad to raise a bug if this looks like an SST bug and not a newbie bug :)


  -- Jeff

ERROR: test_SST_aaa (sst.runtests.TestSst_Aaa)
Traceback (most recent call last):
  File "C:\Python26\lib\site-packages\sst\runtests.py", line 260, in test
    exec self.code in context
  File "C:\Zope\aps.um.buildout.20110315\parts\inst1\Products\APSUM\tests\SST\SS
T_aaa.py", line 19, in <module>
  File "C:\Python26\lib\site-packages\sst\actions.py", line 1049, in dismiss_ale
    _alert_action('dismiss', expected_text, text_to_write)
  File "C:\Python26\lib\site-packages\sst\actions.py", line 1001, in _alert_acti
    window_handle = browser.current_window_handle
  File "C:\Python26\lib\site-packages\selenium\webdriver\remote\webdriver.py", l
ine 455, in current_window_handle
    return self.execute(Command.GET_CURRENT_WINDOW_HANDLE)['value']
  File "C:\Python26\lib\site-packages\selenium\webdriver\remote\webdriver.py", l
ine 153, in execute
  File "C:\Python26\lib\site-packages\selenium\webdriver\remote\errorhandler.py"
, line 147, in check_response
    raise exception_class(message, screen, stacktrace)
WebDriverException: Message: u'Modal dialog present'

Question information

English Edit question
selenium-simple-test Edit question
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Corey Goldberg (coreygoldberg) said :

I think you are running into a bug that was recently fixed in SST.

details of my fix here: https://code.launchpad.net/~coreygoldberg/selenium-simple-test/alert-action-windowhandle

It was introduced when upgrading to selenium 2.18. this fix is available in SST trunk, but has not been released to PyPI yet.

which version of selenium package are you currently using?
if possible, upgrade to the latest selenium (> 2.18) release and run SST's trunk code.

please respond back if you need any help, and feel free to raise a bug if it persists.


Revision history for this message
Tommy Shelby (bumble-bee) said :

Thanks for expressing your views here. Do you have any idea about the current one?


Can you help with this problem?

Provide an answer of your own, or ask Jeff Kunce for more information if necessary.

To post a message you must log in.