/** * {@inheritDoc} * * @throws WebDriverException when current session doesn't support the given selector or when * value of the selector is not consistent. * @throws IllegalArgumentException when it is impossible to find something on the given * {@link SearchContext} instance */ @Override public WebElement findElement(SearchContext context) throws WebDriverException, IllegalArgumentException { Class<?> contextClass = context.getClass(); if (FindsByAndroidUIAutomator.class.isAssignableFrom(contextClass)) { return FindsByAndroidUIAutomator.class.cast(context) .findElementByAndroidUIAutomator(getLocatorString()); } if (FindsByFluentSelector.class.isAssignableFrom(contextClass)) { return super.findElement(context); } throw formIllegalArgumentException(contextClass, FindsByAndroidUIAutomator.class, FindsByFluentSelector.class); }
@Override public WebElement findElementByAndroidUIAutomator(String using) { return ((FindsByAndroidUIAutomator) super.getWrappedDriver()) .findElementByAndroidUIAutomator(using); }
@Override public WebElement findElementByAndroidUIAutomator(String using) { return ((FindsByAndroidUIAutomator) getElement()).findElementByAndroidUIAutomator(using); }
@Override public WebElement findElementByAndroidUIAutomator(String using) { return ((FindsByAndroidUIAutomator) super.getWrappedDriver()) .findElementByAndroidUIAutomator(using); }
/** * {@inheritDoc} * * @throws WebDriverException when current session doesn't support the given selector or when * value of the selector is not consistent. * @throws IllegalArgumentException when it is impossible to find something on the given * {@link SearchContext} instance */ @Override public WebElement findElement(SearchContext context) throws WebDriverException, IllegalArgumentException { Class<?> contextClass = context.getClass(); if (FindsByAndroidUIAutomator.class.isAssignableFrom(contextClass)) { return FindsByAndroidUIAutomator.class.cast(context) .findElementByAndroidUIAutomator(getLocatorString()); } if (FindsByFluentSelector.class.isAssignableFrom(contextClass)) { return super.findElement(context); } throw formIllegalArgumentException(contextClass, FindsByAndroidUIAutomator.class, FindsByFluentSelector.class); }
@Override public WebElement findElementByAndroidUIAutomator(String using) { if (driverIsDisabled()) { return this; } return ((FindsByAndroidUIAutomator) getElement()).findElementByAndroidUIAutomator(using); }