@Override public ElementFinder toElementFinder(ElementFinder leftFinder) { throw new UnsupportedPseudoClassException(":animated", "This selector uses internals of jQuery that nor seleniumQuery, " + "neither the user should access."); }
@Override public ElementFinder toElementFinder(ElementFinder leftFinder) { throw new UnsupportedPseudoClassException(":animated", "This selector uses internals of jQuery that nor seleniumQuery, " + "neither the user should access."); }
private void assertCssDoesNotContainUnsupportedSelectors(String cssString) { if (StringUtils.containsAny(cssString, ' ', '>', '~', '+')) { throw new UnsupportedPseudoClassException(":not() with descendant (a b, a>b) or sibling (a+b, a~b) selectors as argument is not yet supported."); } }
private void assertCssDoesNotContainUnsupportedSelectors(String cssString) { if (StringUtils.containsAny(cssString, ' ', '>', '~', '+')) { throw new UnsupportedPseudoClassException(":not() with descendant (a b, a>b) or sibling (a+b, a~b) selectors as argument is not yet supported."); } }
public AstCssPseudoClassCondition translate(SimpleSelector selectorUpToThisPoint, ArgumentMap argumentMap, AttributeCondition attributeCondition) { String pseudoClassName = getPseudoClassName(attributeCondition); Function<String, ? extends AstCssPseudoClassCondition> pseudoClass = pseudoClassesF.get(pseudoClassName); if (pseudoClass == null) { throw new UnsupportedPseudoClassException(argumentMap, selectorUpToThisPoint, pseudoClassName); } String argumentValue = calculateFunctionalPseudoClassArgument(argumentMap, attributeCondition.getValue()); try { return pseudoClass.apply(argumentValue); } catch (AstCssFunctionalPseudoClassHasNoArgumentsException e) { throw new IllegalArgumentException("Functional pseudo-class has no parenthesis/arguments: " + attributeCondition.getValue(), e); } }
public AstCssPseudoClassCondition translate(SimpleSelector selectorUpToThisPoint, ArgumentMap argumentMap, AttributeCondition attributeCondition) { String pseudoClassName = getPseudoClassName(attributeCondition); Function<String, ? extends AstCssPseudoClassCondition> pseudoClass = pseudoClassesF.get(pseudoClassName); if (pseudoClass == null) { throw new UnsupportedPseudoClassException(argumentMap, selectorUpToThisPoint, pseudoClassName); } String argumentValue = calculateFunctionalPseudoClassArgument(argumentMap, attributeCondition.getValue()); try { return pseudoClass.apply(argumentValue); } catch (AstCssFunctionalPseudoClassHasNoArgumentsException e) { throw new IllegalArgumentException("Functional pseudo-class has no parenthesis/arguments: " + attributeCondition.getValue(), e); } }
@Override public ConditionComponent conditionToXPath(ArgumentMap argumentMap, Selector selectorUpToThisPoint, AttributeCondition attributeCondition) { String pseudoClassValue = attributeCondition.getValue(); for (PseudoClass pseudoClass : pseudoClasses) { if (pseudoClass.isApplicable(pseudoClassValue)) { return pseudoClass.pseudoClassToXPath(new PseudoClassSelector(argumentMap, selectorUpToThisPoint, pseudoClassValue)); } } PseudoClassSelector pseudoClassSelector = new PseudoClassSelector(argumentMap, selectorUpToThisPoint, pseudoClassValue); // right now we'll just exit, hoping to cause less problems throw new UnsupportedPseudoClassException(pseudoClassSelector.getOriginalPseudoClassSelector()); }
@Override public ConditionComponent conditionToXPath(ArgumentMap argumentMap, Selector selectorUpToThisPoint, AttributeCondition attributeCondition) { String pseudoClassValue = attributeCondition.getValue(); for (PseudoClass pseudoClass : pseudoClasses) { if (pseudoClass.isApplicable(pseudoClassValue)) { return pseudoClass.pseudoClassToXPath(new PseudoClassSelector(argumentMap, selectorUpToThisPoint, pseudoClassValue)); } } PseudoClassSelector pseudoClassSelector = new PseudoClassSelector(argumentMap, selectorUpToThisPoint, pseudoClassValue); // right now we'll just exit, hoping to cause less problems throw new UnsupportedPseudoClassException(pseudoClassSelector.getOriginalPseudoClassSelector()); }