I have a checkbox on my webpage that starts in a state of false and I want to use SST to toggle it to true. However, I keep receiving the AssertionError: Checkbox u'%' - was not toggled, value remains: False
. I have used both set_checkbox_value()
and toggle_checkbox()
and receive the same error with both. My line of code right now reads toggle_checkbox(id_or_elem='cbLFav')
. The stacktrace is:
DEBUG:SST:Checkbox: u'cbLFav' - was not toggled, value remains: False
DEBUG:SST:Stopping browser
FAIL (63.522 secs)
======================================================================
FAIL: ..04fitness-tracker
----------------------------------------------------------------------
Traceback (most recent call last):
File "C:\Users\Brenda\brenda_test\ENV\lib\site-packages\sst\cases.py", line 20
7, in run_test_script
exec self.code in self.context
File ".\04fitness-tracker.py", line 24, in <module>
toggle_checkbox(id_or_elem='cbLFav')
File "C:\Users\Brenda\brenda_test\ENV\lib\site-packages\sst\actions.py", line
467, in toggle_checkbox
_raise(msg)
File "C:\Users\Brenda\brenda_test\ENV\lib\site-packages\sst\actions.py", line
118, in _raise
raise AssertionError(msg)
AssertionError: Checkbox: u'cbLFav' - was not toggled, value remains: False
When using set_checkbox_value
, my code looks like set_checkbox_value('cbLFav', True)
. Any idea why this isn't setting the value to True?
Code looks like: <input type="checkbox" value="true" class="np_add_fav_cb" id="cbLFav" name="fav">