Skip to content
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

I can see '\u200e' being added to the beginning and the end of the text I am looking for using textMatches . #294

Open
ancan-netizen opened this issue Nov 3, 2020 · 2 comments

Comments

@ancan-netizen
Copy link

No description provided.

@ancan-netizen
Copy link
Author

ancan-netizen commented Nov 3, 2020

I want to connect to a bluetooth device, there are 2 devices with similar name. The names are abc123 and deabc123. I would like to connect with abc123, so I would like to give textMatches to abc123, if I do so I get the bellow error

Traceback (most recent call last):
File "", line 1, in
File "C:\Users\Desktop\handset\uiautomator_init_.py", line 80, in call
return self.func(*args, **kwargs)
File "C:\Users\Desktop\handset\uiautomator_init_.py", line 883, in click
return self.jsonrpc.click(self.selector)
File "C:\Users\Desktop\handset\uiautomator_init
.py", line 355, in wrapper
return method_obj(*args, **kwargs)
File "C:\Users\Desktop\handset\uiautomator_init
.py", line 140, in call
"%s: %s" % (jsonresult["error"]["data"], jsonresult["error"]["message"])
uiautomator.JsonRPCError: JsonRPC Error code: -32002, Message: {'exceptionTypeName': 'android.support.test.uiautomator.UiObjectNotFoundException', 'message': 'UiSelector[CLASS=android.widget.TextView, TEXT_REGEX=abc123, RESOURCE_ID=android:id/title]'}: UiSelector[CLASS=android.widget.TextView, TEXT_REGEX=abc123, RESOURCE_ID=android:id/title]

and if I use textContains it matches with the device which appears first on the page, so sometimes with abc123 and other times with deabc123

JSON call:
{'jsonrpc': '2.0', 'method': 'getText', 'id': 'd529221e5f66c0037e0f5f8d13435a68', 'params': ({'mask': 2097170, 'childOrSibling': [], 'childOrSiblingSelector': [], 'textContains': 'abc123', 'className': 'android.widget.TextView', 'resourceId': 'android:id/title'},)}
JSON result:
{'jsonrpc': '2.0', 'id': 'd529221e5f66c0037e0f5f8d13435a68', 'result': '\u200deabc123\u200e'}

Kindly help with this. Thanking in advance

@ancan-netizen ancan-netizen changed the title I can see '/u200e' being added to the beginning and the end of the text I am looking for using textMatches . I can see '\u200e' being added to the beginning and the end of the text I am looking for using textMatches . Nov 3, 2020
@hongbinbao
Copy link
Collaborator

what's your android SDK version?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants