Find a Element that has a attribute with a certain value and click it

@param attributeName
@param attributeValue
965409
public void clickElementWithAttributeValue(String attributeName, String attributeValue) {
        By xpath = By.xpath("//*[@" + attributeName + "='" + attributeValue + "']");
        WebElement element = seleniumElementService.findExpectedElement(xpath);
        assertTrue("The element you are trying to click (" + xpath.toString() + ") is not displayed", element.isDisplayed());
        element.click();
    }
1006476
public static boolean getAttributeAsBoolean(XmlPullParser parser, String attributeName, boolean defaultValue) throws Exception {
		// parser.getText()
		String value = parser.getAttributeValue(null, attributeName);

		if (!StringUtils.hasText(value)) {
			return defaultValue;
		}

		return Boolean.parseBoolean(value);
	}
232194
public VoltXMLElement findChild(String elementName, String attributeName)
    {
        String attName = attributeName;
        if (attName == null) {
            attName = "default";
        }
        return findChild(elementName + attName);
    }
1336500
public static Boolean getAttributeBoolean(Tag tag, String attrName) throws EvaluatorException {
	Boolean b = getAttributeLiteral(tag, attrName).getBoolean(null);
	if (b == null) throw new EvaluatorException("attribute [" + attrName + "] must be a constant boolean value");
	return b;
    }
1022097
public boolean hasAttr(String attributeKey) {
        for (Element element : this) {
            if (element.hasAttr(attributeKey))
                return true;
        }
        return false;
    }
994701
private List<String> findUrlsInAttributeValue(final String attributeValue) {
        List<String> foundUrls = new ArrayList<>();

        urlPatterns.stream()
                .map((Pattern urlPattern) -> urlPattern.matcher(attributeValue))
                .forEach((Matcher urlPatternMatcher) -> {
                    while (urlPatternMatcher.find()) {
                        String foundUrl = urlPatternMatcher.group().trim();

                        if (validator.test(foundUrl)) {
                            foundUrls.add(foundUrl);
                        }
                    }
                });

        return foundUrls;
    }
154724
public static Boolean getAttributeBoolean(Tag tag, String attrName, Boolean defaultValue) {
	Literal lit = getAttributeLiteral(tag, attrName, null);
	if (lit == null) return defaultValue;
	return lit.getBoolean(defaultValue);
    }
1146389
public void pushAttributeValueEvent(final String deviceName, final String attributeName) throws DevFailed {
        xlogger.entry();
        for (final EventType eventType : EventType.getEventAttrValueTypeList()) {
            pushAttributeValueEventIdlLoop(deviceName, attributeName, eventType);
        }
        xlogger.exit();
    }
238686
public Attribute<?> getAttribute(String attributeName) {
    for (Attribute<?> attribute : getAllAttributes()) {
      if (attribute.getAttributeName().equals(attributeName)) {
        return attribute;
      }
    }
    return null;
  }
91723
@SuppressWarnings("nullness")
  private static String attributeValueToString(AttributeValue attributeValue) {
    return attributeValue.match(
        returnToString,
        returnToString,
        returnToString,
        returnToString,
        Functions.<String>returnConstant(""));
  }
1035625
static void extractAttributeValue(Elements elementUtils, Element item, String annotationName, AnnotationAttributeType attribute, OnAttributeFoundListener listener) {
		List<? extends AnnotationMirror> annotationList = elementUtils.getAllAnnotationMirrors(item);
		for (AnnotationMirror annotation : annotationList) {			
			if (annotationName.equals(annotation.getAnnotationType().asElement().toString())) {
				// found annotation
				for (Entry<? extends ExecutableElement, ? extends AnnotationValue> annotationItem : elementUtils.getElementValuesWithDefaults(annotation).entrySet()) {
					if (attribute.isEquals(annotationItem.getKey())) {
						listener.onFound(annotationItem.getValue().toString());
						return;
					}
				}
			}
		}
	}
1114971
@Override
	public boolean isAttributePresent(String attributeName) throws WidgetException {
		try {
			WebElement webElement = null;
			String attrValue = null;

			// WebDriver get attribute
			try {
				webElement = findElement();
				attrValue = webElement.getAttribute(attributeName);
				highlight(HIGHLIGHT_MODES.GET);
			} catch (Exception e) {
				throw new RuntimeException("Exception happened at locator: " + locator + " attribute: " + attributeName + e.getMessage());
			}

			if (attrValue != null) {
				return true;
			}

			return false;
		} catch (Exception e) {
			throw new WidgetException("Error while determining if attribute is present: " + attributeName, locator, e);
		}
	}
399443
public void waitForAttributeNotEqualTo(final String attributeName, final String attributeValue, long timeout) throws WidgetTimeoutException {
		waitForCommand(new ITimerCallback() {

			@Override
			public boolean execute() throws WidgetException {
				String val = getAttribute(attributeName);

				if (val == null && attributeName == null)
					return true;

				if (val == null || attributeName == null)
					return false;

				if (!val.equals(attributeValue))
					return true;

				return false;
			}

			@Override
			public String toString() {
				return "Waiting for attribute, " + ((attributeName == null) ? "" : attributeName) + ", to not equal: " + ((attributeValue == null) ? "" : attributeValue) + " - for the element with the locator: " + locator;
			}
		}, timeout);

	}
1219301
public int getValue(String attributeName, int defaultValue) {
        A attribute = getAt(attributeName);
        Object attributeValue = (attribute == null) ? null : attribute.getValue();
        return (attributeValue == null) ? defaultValue : Integer.parseInt(attributeValue.toString());
    }
848475
public void setAttribute(String attributeName, Object value) {
        synchronized (_iSession) {
            if (!_iSession.isValid())
                throw new IllegalStateException();
            if (null != value) {
                if (!(value instanceof HttpSessionBindingListener)) {
                    _iSession.setAttribute(attributeName, value, Boolean.FALSE);
                } else {
                    _iSession.setAttribute(attributeName, value, Boolean.TRUE);
                }
            }
        }
    }
841219
public void addAttributeValuesToSaml2Attribute(final String attributeName,
                                                   final Object attributeValue,
                                                   final String valueType,
                                                   final List<XMLObject> attributeList) {
        addAttributeValuesToSamlAttribute(attributeName, attributeValue, valueType, attributeList, AttributeValue.DEFAULT_ELEMENT_NAME);
    }
988541
public SingleNodeAssert hasAttribute(String attributeName, String attributeValue) {
        isNotNull();

        final Map.Entry<QName, String> attribute = attributeForName(attributeName);
        if (attribute == null || !attribute.getValue().equals(attributeValue)) {
            throwAssertionError(shouldHaveAttributeWithValue(actual.getNodeName(), attributeName, attributeValue));
        }

        return this;
    }