com.automation.executionhelper.IdentifierCollection Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of webdriver-helper-utils Show documentation
Show all versions of webdriver-helper-utils Show documentation
User can use webdriver with self managed mode. Just write test cases and use slandered method provided
for preforming ui operations. Debug mode for getting more detailed route cause analysis.
package com.automation.executionhelper;
import org.apache.log4j.Logger;
import org.openqa.selenium.By;
import java.util.HashMap;
import java.util.Map;
public class IdentifierCollection {
private final static Logger logger = Logger.getLogger(IdentifierCollection.class);
private static HashMap identifierCollection = new HashMap<>();
public static void put(HashMap collection) {
logger.info("Bulk identifiers added to collection");
for (Map.Entry entry : collection.entrySet()) {
identifierCollection.put((String) entry.getKey(), (By) entry.getValue());
}
}
public static void put(String key, By value) {
logger.debug("Identifiers " + key + " added to collection with value "+ value);
identifierCollection.put(key, value);
}
public static By get(String key) {
By iden = identifierCollection.get(key);
logger.debug("Returning value for " + key + ", With Value: "+ iden);
return iden;
}
public static void loadIdentifier(String key, By value) {
logger.debug("Identifiers " + key + " added to collection");
identifierCollection.put(key, value);
}
@Deprecated
public static By getElement(String key) {
return identifierCollection.get(key);
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy