/**
* This method will verify the text of the current element is the random code or not.
*
* @param elementName
* The name of the current element.
*
* @param expectSize
* The location of random code.
*
*/
public boolean verifyIsRandomCode(String elementName, String expectSize) {
boolean flag = false;
String elementLocator = uiMapElementLocator("", "", elementName);
String randomCode = ui.getText(elementLocator);
Pattern pattern = Pattern.compile("[A-Za-z0-9]*");
if(pattern.matcher(randomCode).matches() && (randomCode.length() == Integer.parseInt(expectSize))){
flag = true;
}
return flag;
}