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

[Android][Appium 1.3.5] Appium does not recognize non ascii char in text attribute #4611

Closed
ktronic80 opened this issue Feb 26, 2015 · 10 comments
Labels
Android related to Android-native driver(s) Bug a problem that needs fixing

Comments

@ktronic80
Copy link
Contributor

Hi,

since Appium 1.3.5 I have a problem with non ascii characters in the text attribute of an Android ui element.
I have the following xpath to find an element //[@text='Löschen'].
After the update to Appium 1.3.5 the test is failing with previous versions it works fine. In the Appium log I just see this
info: <-- POST /wd/hub/session/0e33042c-1e79-46c5-8d37-a33eefe7e98f/timeouts/implicit_wait 200 0.861 ms - 76 {"status":0,"value":null,"sessionId":"0e33042c-1e79-46c5-8d37-a33eefe7e98f"}
info: --> POST /wd/hub/session/0e33042c-1e79-46c5-8d37-a33eefe7e98f/element {"using":"xpath","value":"//
[@text='Löschen']"}
info: [debug] Waiting up to 10000ms for condition
info: [debug] Pushing command to appium work queue: ["find",{"strategy":"xpath","selector":"//[@text='Löschen']","context":"","multiple":false}]
info: [debug] [BOOTSTRAP] [debug] Got data from client: {"cmd":"action","action":"find","params":{"strategy":"xpath","selector":"//
[@text='Löschen']","context":"","multiple":false}}
info: [debug] [BOOTSTRAP] [debug] Got command of type ACTION
info: [debug] [BOOTSTRAP] [debug] Got command action: find
info: [debug] [BOOTSTRAP] [debug] Finding //*[@text='Löschen'] using XPATH with the contextId: multiple: false
info: [debug] [BOOTSTRAP] [debug] Returning result: {"value":"Could not find an element using supplied strategy. ","status":7}
info: [debug] Waited for 69ms so far

When viewing the element in the Appium inspector you can see that instead ö it shows ? and when using the xpath //*[@text='L?schen'] it finds the element.

It looks like that something is messed up with recognizing non ascii characters.
appium_1 3 5

@triager triager added the Needs Triage bugs which are not yet confirmed label Feb 26, 2015
@amedvedjev
Copy link
Contributor

did you try normalizer?
met same issue fixed my normalizing search text. see #4421 for details

@chenhengjie123
Copy link

I found that this issue is caused by commit use custome NodeInfoDumper and handle empty root nodes properly. It changes getRawXMLHierarchy() function to use custom dumper and that dumper would translate all non ascii char to ? in AccessibilityNodeInfoDumper's safeCharSeqToString() function.

Since this commit is just in 1.3.5-beta1 and 1.3.5, you can revert to use 1.3.4 to get through this problem.

@medy75
Copy link

medy75 commented Mar 2, 2015

Possibly same issue as mine: #4583
Any idea how to fix it? I cannot revert to 1.3.4 because of findElement issue.

@0x1mason
Copy link

0x1mason commented Mar 3, 2015

We'll get this in the next release.

@0x1mason 0x1mason added Bug a problem that needs fixing Android related to Android-native driver(s) and removed Needs Triage bugs which are not yet confirmed labels Mar 3, 2015
@0x1mason 0x1mason assigned 0x1mason and unassigned JessicaSachs Mar 3, 2015
@0x1mason 0x1mason added this to the Appium 1.3.7 milestone Mar 3, 2015
@0x1mason
Copy link

0x1mason commented Mar 3, 2015

Another option would be to not use XPath.

@ktronic80
Copy link
Contributor Author

Thanks. For now its ok for to me to use Appium 1.3.4. for Android.
@0x1mason Which other locator would work? Can I use name or linkText? Currently I only have the possibilty to identify the element by the text.

@0x1mason
Copy link

0x1mason commented Mar 3, 2015

Got a fix for this. Will be available soon.

@0x1mason 0x1mason closed this as completed Mar 3, 2015
@0x1mason
Copy link

0x1mason commented Mar 3, 2015

@ktronic80 Try find_by_name.

@0x1mason
Copy link

0x1mason commented Mar 4, 2015

1.3.6 is out with the fix.

@lock
Copy link

lock bot commented May 1, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot unassigned 0x1mason May 1, 2019
@lock lock bot locked and limited conversation to collaborators May 1, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Android related to Android-native driver(s) Bug a problem that needs fixing
Projects
None yet
Development

No branches or pull requests

7 participants