Skip to content
Advertisement

Cannot access numeric value of cell from a String cell

I am trying to read an excel file and execute my test case accordingly, now the error I am getting is java.lang.IllegalStateException: Cannot get a STRING value from a NUMERIC cell Here is my implementation of the code: You might notice that I have user String.valueOf(); but to no avail.

JavaScript

And here is my code for method call:

JavaScript

My imports are as follows

JavaScript

Advertisement

Answer

You can have check of Cell_Type before getting the cell value.

JavaScript

Imports:

JavaScript

Maven dependencies:

JavaScript

Remove the below import

JavaScript
User contributions licensed under: CC BY-SA
11 People found this is helpful
Advertisement