-
-
Notifications
You must be signed in to change notification settings - Fork 150
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
If by.xpath contains utf8 symbols and not condition get UnicodeEncodeError: 'ascii' #124
Comments
Which version of python do you use? |
python 2.7.12 |
try to user it like
|
Object will not be found s(by.xpath("//button[contains(.,u'Объекты')]")) It's work: s(by.xpath("//button[contains(.,'Объекты')]")) but object is not found, get UnicodeEncodeError diff --git a/selene/wait.py b/selene/wait.py index afc5e69..a9e9f3d 100644 --- a/selene/wait.py +++ b/selene/wait.py @@ -14,6 +14,8 @@ def wait_for(entity, condition, timeout=4, polling=0.1): reason_message = getattr(reason, 'msg', getattr(reason, 'message', getattr(reason, 'args', ''))) + if isinstance(reason_message, unicode): + reason_message = reason_message.encode('unicode-escape') reason_string = '{name}: {message}'.format(name=reason.__class__.__name__, message=reason_message) screen = getattr(reason, 'screen', None) stacktrace = getattr(reason, 'stacktrace', None) |
could you please create PR for this |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
The text was updated successfully, but these errors were encountered: