PageUtil.clickOnButton(driver, AppXPathsConstants.UserAdminAddNewuser);

String id ="1517838839328";
String newid = "1517838839328" + (Integer.parseInt(id.substring(1,id.length()))+1);

PageUtil.inputFieldEntry(driver, user_id,newid);
  1. First line I clck on Add button
  2. Second line I enter the id
  3. Third line I am incrementing the id value by 1
  4. Fourth line is newid value which contains the incremented value

But it is not getting incremented and I am getting the java.lang.NumberFormatException.


The maximum number you can parse to integer is 2147483647 while you're trying to parse 200 times bigger number

Try to use Long.parseLong() instead.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.