public List<CandidateElement> getCandidateElementsForInputs(EmbeddedBrowser browser,
			Element sourceElement, EventableCondition eventableCondition) {
		List<CandidateElement> candidateElements = new ArrayList<>();
		int maxValues = getMaxNumberOfValues(eventableCondition.getLinkedInputFields());

		if (maxValues == EMPTY) {
			LOGGER.warn("No input values found for element: "
					+ DomUtils.getElementString(sourceElement));
			return candidateElements;
		}

		try {
			final Document dom =
					DomUtils.asDocument(browser.getStrippedDomWithoutIframeContent());

			// add maxValues Candidate Elements for every input combination
			for (int curValueIndex = 0; curValueIndex < maxValues; curValueIndex++) {
				List<FormInput> formInputsForCurrentIndex = new ArrayList<>();
				for (FormInput input : eventableCondition.getLinkedInputFields()) {
					try {
						Element element = (Element) getBelongingNode(input, dom);
						if (element != null) {
							FormInput formInput =
									getFormInputWithIndexValue(browser, element, curValueIndex);
							formInputsForCurrentIndex.add(formInput);
						} else {
							LOGGER.warn("Could not find input element for: " + input);
						}
					} catch (XPathExpressionException e) {
						LOGGER.warn("Could not find input element for: " + input);
						LOGGER.error(e.getMessage(), e);
					}
				}

				String id = eventableCondition.getId() + "_" + curValueIndex;
				//sourceElement.setAttribute("atusa", id);

				// clone node inclusive text content
				Element cloneElement = (Element) sourceElement.cloneNode(false);
				cloneElement.setTextContent(DomUtils.getTextValue(sourceElement));

				CandidateElement candidateElement = new CandidateElement(cloneElement,
						XPathHelper.getXPathExpression(sourceElement), formInputsForCurrentIndex);
				candidateElements.add(candidateElement);
			}
		} catch (IOException e) {
			LOGGER.error("Caught IOException while parsing DOM", e);
			return candidateElements;
		}
		return candidateElements;
	}
public List < CandidateElement > getCandidateElementsForInputs ( EmbeddedBrowser browser , Element sourceElement , EventableCondition eventableCondition ) { List < CandidateElement > candidateElements = new ArrayList < > ( ) ; int maxValues = getMaxNumberOfValues ( eventableCondition . getLinkedInputFields ( ) ) ; if ( maxValues == EMPTY ) { LOGGER . warn ( "No input values found for element: " + DomUtils . getElementString ( sourceElement ) ) ; return candidateElements ; } try { final Document dom = DomUtils . asDocument ( browser . getStrippedDomWithoutIframeContent ( ) ) ; for ( int curValueIndex = 0 ; curValueIndex < maxValues ; curValueIndex ++ ) { List < FormInput > formInputsForCurrentIndex = new ArrayList < > ( ) ; for ( FormInput input : eventableCondition . getLinkedInputFields ( ) ) { try { Element element = ( Element ) getBelongingNode ( input , dom ) ; if ( element != null ) { FormInput formInput = getFormInputWithIndexValue ( browser , element , curValueIndex ) ; formInputsForCurrentIndex . add ( formInput ) ; } else { LOGGER . warn ( "Could not find input element for: " + input ) ; } } catch ( XPathExpressionException e ) { LOGGER . warn ( "Could not find input element for: " + input ) ; LOGGER . error ( e . getMessage ( ) , e ) ; } } String id = eventableCondition . getId ( ) + "_" + curValueIndex ; Element cloneElement = ( Element ) sourceElement . cloneNode ( false ) ; cloneElement . setTextContent ( DomUtils . getTextValue ( sourceElement ) ) ; CandidateElement candidateElement = new CandidateElement ( cloneElement , XPathHelper . getXPathExpression ( sourceElement ) , formInputsForCurrentIndex ) ; candidateElements . add ( candidateElement ) ; } } catch ( IOException e ) { LOGGER . error ( "Caught IOException while parsing DOM" , e ) ; return candidateElements ; } return candidateElements ; }
@param browser            the browser instance
@param sourceElement      the form elements
@param eventableCondition the belonging eventable condition for sourceElement
@return a list with Candidate elements for the inputs