java.lang.Error: Unresolved compilation problems:
specialChr cannot be resolved to a variable
lowerCase cannot be resolved to a variable
更早地使用相同的代码即可获取错误异常。
我也有局部变量,但始终在小写和规范大小写的情况下出错
@Test(priority = 5)
public void npaCheckUpSignUpReschedulingAndCancellingAppointment()
throws IOException, BiffException, InterruptedException {
// generating user-name, password and confirm password.
String userName = generateRandom(aToZ);
System.out.println("UserName: " + userName);
log = Logger.getLogger(CheckUpNPA.class);
log.info("npaCheckUpSignUpReschedulingAndCancellingAppointment - Username: " + userName + "");
// item 1
WebElement createUserName = driver.findElement(By.xpath("//input[@id=" + readExcel(74, 3, 0) + "]"));
fluientWaitforElement(createUserName, 20, 5);
isElementPresent(createUserName);
createUserName.sendKeys(userName);
// generating special character for password
String specialCharacter = generateRandomSpecial(specialChr);
// generating upper case character for the password
String upperCaseCharacter = generateupperCase(upperCase);
// generating lower case character for the password
String lowerCaseCharacter = generatelowerCase(lowerCase);
// generating number for the password
String number = generatenumeral(numerals);
String passWord = upperCaseCharacter + lowerCaseCharacter + specialCharacter + number;
System.out.println("PassWord: " + passWord);
log = Logger.getLogger(CheckUpNPA.class);
log.info("npaCheckUpSignUpReschedulingAndCancellingAppointment - Password: " + passWord + "");
代码应使用相同的字符串规格char和小写字母。