Skip to content

Commit 1e80714

Browse files
mykola-mokhnachsaikrishna321
authored andcommitted
Add a setting for tag names normalization (#1073)
* Add a setting for tag names normalization * wording
1 parent b10f521 commit 1e80714

File tree

2 files changed

+16
-0
lines changed

2 files changed

+16
-0
lines changed

src/main/java/io/appium/java_client/Setting.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ public enum Setting {
3333
FIX_IMAGE_TEMPLATE_SIZE("fixImageTemplateSize"),
3434
CHECK_IMAGE_ELEMENT_STALENESS("checkForImageElementStaleness"),
3535
UPDATE_IMAGE_ELEMENT_POSITION("autoUpdateImageElementPosition"),
36+
NORMALIZE_TAG_NAMES("normalizeTagNames"),
3637
IMAGE_ELEMENT_TAP_STRATEGY("imageElementTapStrategy");
3738

3839
private String name;

src/main/java/io/appium/java_client/android/HasAndroidSettings.java

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -84,4 +84,19 @@ default void configuratorSetKeyInjectionDelay(Duration delay) {
8484
default void configuratorSetActionAcknowledgmentTimeout(Duration timeout) {
8585
setSetting(Setting.WAIT_ACTION_ACKNOWLEDGMENT_TIMEOUT, timeout.toMillis());
8686
}
87+
88+
/**
89+
* Setting this value to true will enforce source tree dumper
90+
* to transliterate all class names used as XML tags to the limited
91+
* set of ASCII characters supported by Apache Harmony
92+
* lib and used by default in Android to avoid possible
93+
* XML parsing exceptions caused by XPath lookup.
94+
* The Unicode to ASCII transliteration is based on
95+
* JUnidecode library (https://github.com/gcardone/junidecode).
96+
*
97+
* @param enabled Either true or false. The default value if false.
98+
*/
99+
default void normalizeTagNames(boolean enabled) {
100+
setSetting(Setting.NORMALIZE_TAG_NAMES, enabled);
101+
}
87102
}

0 commit comments

Comments
 (0)