Search in sources :

Example 31 with Identifier

use of org.cerberus.engine.entity.Identifier in project cerberus-source by cerberustesting.

the class IdentifierService method getIdentifier.

private Identifier getIdentifier(String input, String defaultIdentifier) {
    Identifier result = new Identifier();
    String identifier;
    String locator;
    String[] strings = input.split("=", 2);
    if (strings.length == 1) {
        identifier = defaultIdentifier;
        locator = strings[0];
    } else {
        identifier = strings[0];
        locator = strings[1];
    }
    result.setIdentifier(identifier);
    result.setLocator(locator);
    return result;
}
Also used : Identifier(org.cerberus.engine.entity.Identifier)

Aggregations

Identifier (org.cerberus.engine.entity.Identifier)31 MessageEvent (org.cerberus.engine.entity.MessageEvent)30 CerberusEventException (org.cerberus.exception.CerberusEventException)20 WebDriverException (org.openqa.selenium.WebDriverException)12 NoSuchElementException (org.openqa.selenium.NoSuchElementException)8 PatternSyntaxException (java.util.regex.PatternSyntaxException)5 AnswerItem (org.cerberus.util.answer.AnswerItem)2 Matcher (java.util.regex.Matcher)1 Pattern (java.util.regex.Pattern)1