Ask a Question

Outbounde Exception the second time that I try to read an Excel with SoapUI

SOLVED
d82ej9dut
Occasional Contributor

Outbounde Exception the second time that I try to read an Excel with SoapUI

Hello everybody.

 

I'm trying to read the datas of an excel with the objects

 

wb = Workbook.getWorkbook(new File('C:/Users/Franciscog/Desktop/papageno1.xls')) 

 

It works fine the first time that I use, but the second time, I get this message:

java.lang.ArrayIndexOutOfBound.Exception:0error at line: 12

 

I have to add new rows and columns to the excel in order to make it works again. Any idea of why is it?

 

Thanks a lot in advanceTestingServer (172.29.106.161) - Remote Desktop Connection Manager v2.7.jpg

10 REPLIES 10
sanj
Super Contributor

Just an thought

may you need to initialize where you starting from.

just a thought I got no clue what you trying to do

 

groovyguy
Champion Level 0

If you could provide more details and/or your groovy script, it would help to troubleshoot. 




---

Click the Accept as Solution button if my answer has helped, and remember to give kudos where appropriate too!
d82ej9dut
Occasional Contributor

Thanks for your answer.

 

I'm trying to read the datas from an excel. I have tried with this code that I found in Internet, but it is quite strange, because when I execute it for the first time, it works fine, but the second time, I get the error and the creation of the 'getWorkbook' line. However, if I add another row or column to the excel, it works again the first time but in the second fails again.

 

I have attached the code and the excel (97), I hope it is going to help.

 

Thanks a lot again.

nmrao
Champion Level 3

@d82ej9dut, what is the expected output of the given excel data?


Regards,
Rao.
d82ej9dut
Occasional Contributor

The idea would be to take the datas from the excel in order to put it as the values of different fields for a testing of "allowed values". I'm looking for a way to do that and I found this code.

 

Thanks in advance.

 

 

nmrao
Champion Level 3

No, i was not asking for that.

You also have some xml, I was not sure why was that.

Have you tried data driven test?

How are you going to use the data that is read? (otherwise you do not do this exercise right?) That would help understand the use case.


Regards,
Rao.
d82ej9dut
Occasional Contributor

Hello again.

 

Really, I would not need anything of xml, it is just the code that I found for reading datas from an Excel. Now I got this new one that is better.  

 

I need this because I should send messages of vehicles that has some of their fields with just some allowed values, for example, odometer unit: Milles, Hours or Kilometres. Then, I would like to put all those values in an excel and take them for each message (I should send the same number of messages as possible values).

 

Thanks you and best regards.

 

 

nmrao
Champion Level 3

Is the above mentioned exception gone with this attached code?


Regards,
Rao.
d82ej9dut
Occasional Contributor

Hello Rao.

 

Yes, with the last code that I have attached, I had no problem anymore.

 

Thanks a lots and best regards. 

cancel
Showing results for 
Search instead for 
Did you mean: