write_textfield fails on OSX - improper clear action
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
selenium-simple-test |
Confirmed
|
Medium
|
Unassigned |
Bug Description
Bug is really easy to reproduce, just use the function write_textfield
Issue araised due to the fact that OSX uses combination of CMD&A to select all text while in SST code there is only one call to CTRL&A and as a result text is not written properly in the textfield, which causes assertion error on a textfield.
=======
FIX: Function that I've created to work-around this issue
-------
def __osx_clear_
textfield = assert_
textfield.
textfield.
-------
=======
BUG DETAILS
-------
Traceback (most recent call last):
File "/.../sst/
exec self.code in context
...
write_
File "/.../sst/
_raise(msg)
File "/.../sst/
raise AssertionError(msg)
AssertionError: Textfield: 'xxx' - did not write. Text was: u'yyy'
-------
Changed in selenium-simple-test: | |
status: | New → Confirmed |
importance: | Undecided → Medium |
Here is a patch that switches based on the platform and I have found to be reliable:
--- src/sst/actions.py 2012-11-04 11:58:17.000000000 -0800
+++ src/sst/actions.py 2013-01-04 16:12:36.000000000 -0800
@@ -507,7 +507,10 @@
# clear field like this, don't use clear() send_keys( keys.Keys( ).CONTROL, 'a') capabilities. get("platform" , ""): send_keys( keys.Keys( ).COMMAND, 'a') # Mac-only send_keys( keys.Keys( ).CONTROL, 'a')
textfield. send_keys( keys.Keys( ).DELETE)
if clear:
- textfield.
+ if 'Darwin' in browser.
+ textfield.
+ else:
+ textfield.
if isinstance( new_text, unicode):