Try to use [css_text](https://github.com/edx/edx-platform/blob/master/common/djangoapps/terrain/ui_helpers.py#L497) or [css_has_text](https://github.com/edx/edx-platform/blob/master/common/djangoapps/terrain/ui_helpers.py#L283).