Merge lp:~elopio/selenium-simple-test/workaround-alert-dict into lp:selenium-simple-test

Proposed by Leo Arias
Status: Superseded
Proposed branch: lp:~elopio/selenium-simple-test/workaround-alert-dict
Merge into: lp:selenium-simple-test
Diff against target: 14 lines (+4/-0)
1 file modified
src/sst/actions.py (+4/-0)
To merge this branch: bzr merge lp:~elopio/selenium-simple-test/workaround-alert-dict
Reviewer Review Type Date Requested Status
Canonical ISD QA Team Pending
Review via email: mp+83687@code.launchpad.net

This proposal has been superseded by a proposal from 2011-11-28.

Commit message

Workaround the selenium issue that causes the text of an alert to be sometimes returned in a dictionary.

Description of the change

Because of a selenium issue [1], the text of the alert is sometimes returned in a dictionary.
This workaround takes the item from the dictionary when this happens.

[1] http://code.google.com/p/selenium/issues/detail?id=2955

To post a comment you must log in.
220. By Leo Arias

Added a comment with the link to the selenium bug.

Unmerged revisions

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'src/sst/actions.py'
2--- src/sst/actions.py 2011-11-28 17:51:15 +0000
3+++ src/sst/actions.py 2011-11-28 21:15:44 +0000
4@@ -979,6 +979,10 @@
5 waitfor(browser.switch_to_alert)
6 alert = browser.switch_to_alert()
7 alert_text = alert.text
8+ # XXX workaround because Selenium sometimes returns the value in a
9+ # dictionary. See http://code.google.com/p/selenium/issues/detail?id=2955
10+ if isinstance(alert_text, dict):
11+ alert_text = alert_text['text']
12 if expected_text and expected_text != alert_text:
13 error_message = 'Element text should be %r.\nIt is %r.' \
14 % (expected_text, alert_text)

Subscribers

People subscribed via source and target branches