I am fetching the value from excel and passed in my field.am using below code

    if (sh1.getRow(0).getCell(j).getStringCellValue().equals(reg_id)) {
        int k = 1;
        while (k <= sh1.getLastRowNum()) {
            try {
                MethodCall.execution(sh1.getRow(k).getCell(j + 1).getStringCellValue(),
                } catch (Exception e) {
    WebElement Maximum_Discount=Driver.dr.findElement(Organization_Settings_OSPF.Mobile_Number);

But it not pass the value.

closed as off-topic by Bharat Mane, alecxe Mar 8 '18 at 16:00

This question appears to be off-topic. The users who voted to close gave this specific reason:

  • "Questions about software development unrelated to testing are off-topic here, but can be asked on Stack Overflow." – Bharat Mane, alecxe
If this question can be reworded to fit the rules in the help center, please edit the question.

  • String number = "10"; int result = Integer.parseInt(number); System.out.println(result); – Rahul Kant Jha Engg - CX Mar 1 '18 at 9:03
  • 1
    Do you get any error message? – Embedded Mar 1 '18 at 9:50

I cannot see where the error is happening, but, in Java, you transform a String into a Integer in two ways:

1 - Integer x = new Integer("565")

2 - int x = Integer.parseInt("565")

The first on returns the Integer object, and the second one return the primite value of type int.

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