WebDriverException in dismiss_alert()

Asked by Jeff Kunce on 2012-02-09

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)
  dismiss_alert()

Traceback is below.

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

Thanks.

  -- 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>
    dismiss_alert()
  File "C:\Python26\lib\site-packages\sst\actions.py", line 1049, in dismiss_ale
rt
    _alert_action('dismiss', expected_text, text_to_write)
  File "C:\Python26\lib\site-packages\sst\actions.py", line 1001, in _alert_acti
on
    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
    self.error_handler.check_response(response)
  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

Language:
English Edit question
Status:
Answered
For:
selenium-simple-test Edit question
Assignee:
No assignee Edit question
Last query:
2012-02-09
Last reply:
2012-02-09
Corey Goldberg (coreygoldberg) said : #1

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.

-Corey

Tommy Shelby (bumble-bee) said : #2

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

https://typhoon-tv.com/

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.