Salesforce field takes only int values | Selenium Forum
S
Syed Posted on 18/05/2019

I have a field that takes only int values but the data erad from the excel files is returned as a decimal as such(zip code 92122.0)

 

common.enterDetailsTextBox(input, output, "newCustomer.MailingZip/PostalCode", input.get("MailingZip/PostalCode"));

 

the input.get("MailingZip/PostalCode") method within the parameter returns a decimal value from execl as 92122.0

but my common method enterDetailsTextBox() takes parameters as such enterDetailsTextBox(DataRow input, DataRow output,String field, String value)

how do I convert the decimal value received from get to Int but still pass it as a string to my common method?

 

Thanks!


D
Dinkesh Shah Replied on 18/05/2019

Try to enter ' before the numeric value in the excel sheet. This way the POI api will treat it like text and won't add a decimal after the value.


S
Syed Replied on 19/05/2019

@Dinesh Shah

That would be the last thing I would have tried and to my surprise it actually worked.

Thanks for saving the day!

 

Much appreciated

Best,

Syed