Skip to content

Commit

Permalink
handled invalid selector exception and deprecated name from iOSFindBy
Browse files Browse the repository at this point in the history
  • Loading branch information
SrinivasanTarget committed Feb 8, 2016
1 parent c2abfd7 commit c823138
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,7 @@

package io.appium.java_client.pagefactory;

import org.openqa.selenium.InvalidSelectorException;
import org.openqa.selenium.StaleElementReferenceException;

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

if (String.valueOf(e.getMessage()).contains(INVALID_SELECTOR_PATTERN)) {
if (InvalidSelectorException.class.isAssignableFrom(e.getClass())) {
return true;
}

if (String.valueOf(e.getMessage()).contains(INVALID_SELECTOR_PATTERN) || String.valueOf(e.getMessage()).contains("Locator Strategy \\w+ is not supported")) {
return true;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@
String uiAutomator() default "";
String accessibility() default "";
String id() default "";
@Deprecated
/**
* By.name selector is not supported by Appium server node since 1.5.x.
* So this option is going to be removed further. Be careful.
Expand Down

0 comments on commit c823138

Please sign in to comment.