Skip to content

Commit c823138

Browse files
handled invalid selector exception and deprecated name from iOSFindBy
1 parent c2abfd7 commit c823138

File tree

2 files changed

+7
-1
lines changed

2 files changed

+7
-1
lines changed

src/main/java/io/appium/java_client/pagefactory/ThrowableUtil.java

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616

1717
package io.appium.java_client.pagefactory;
1818

19+
import org.openqa.selenium.InvalidSelectorException;
1920
import org.openqa.selenium.StaleElementReferenceException;
2021

2122
import java.lang.reflect.InvocationTargetException;
@@ -28,7 +29,11 @@ static boolean isInvalidSelectorRootCause(Throwable e) {
2829
return false;
2930
}
3031

31-
if (String.valueOf(e.getMessage()).contains(INVALID_SELECTOR_PATTERN)) {
32+
if (InvalidSelectorException.class.isAssignableFrom(e.getClass())) {
33+
return true;
34+
}
35+
36+
if (String.valueOf(e.getMessage()).contains(INVALID_SELECTOR_PATTERN) || String.valueOf(e.getMessage()).contains("Locator Strategy \\w+ is not supported")) {
3237
return true;
3338
}
3439

src/main/java/io/appium/java_client/pagefactory/iOSFindBy.java

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -35,6 +35,7 @@
3535
String uiAutomator() default "";
3636
String accessibility() default "";
3737
String id() default "";
38+
@Deprecated
3839
/**
3940
* By.name selector is not supported by Appium server node since 1.5.x.
4041
* So this option is going to be removed further. Be careful.

0 commit comments

Comments
 (0)