java.lang.Error:未解决的编译问题:specialChr和小写字母不能解析为变量

时间:2019-06-25 05:52:06

标签: java selenium webdriver

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和小写字母。

0 个答案:

没有答案