Import Test Cases from Excel

thumbnail
Angel Guillermo Hidalgo, modified 10 Years ago.

Import Test Cases from Excel

Padawan Posts: 62 Join Date: 12/20/13 Recent Posts
Hi,


I am testing how to import Test Cases from Excel. I have enabled cURL commands. I have created a .xlsx file like the example in the user manual. It is called Formato_TC.xlsx and it is located in: C:\Users\angel.hidalgo\Documents\Instaladores\Klaros>



I have typed the following expression:

C:\Users\angel.hidalgo\Documents\Instaladores\Klaros>curl -v -T Formato_TC.xlsx
'http://localhost:18080/klaros-web/seam/resource/rest/import/testcase/xlsx?confi
g=P000023'



But I got this:


* Protocol 'http not supported or disabled in libcurl
* Closing connection -1
curl: (1) Protocol 'http not supported or disabled in libcurl



I have tried again with this expression:


C:\Users\angel.hidalgo\Documents\Instaladores\Klaros>curl -v -T Formato_TC.xlsx
"http://localhost:18080/klaros-web/seam/resource/rest/import/testcase/xlsx?confi
g=P000023"


The result was:


* Adding handle: conn: 0x9031d0
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x9031d0) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 18080 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 18080 (#0)
> PUT /klaros-web/seam/resource/rest/import/testcase/xlsx?config=P000023 HTTP/1.
1
> User-Agent: curl/7.33.0
> Host: localhost:18080
> Accept: */*
> Content-Length: 11242
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
* We are completely uploaded and fine
< HTTP/1.1 404 No Encontrado
* Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
< Set-Cookie: JSESSIONID=2F304E46DA5CD951DF9ACCAB63BD6658; Path=/klaros-web/; Ht
tpOnly
< Content-Type: text/html;charset=utf-8
< Content-Language: es
< Content-Length: 1285
< Date: Fri, 31 Jan 2014 20:08:34 GMT
<
<html><head><title>Apache Tomcat/7.0.47 - Informe de Error</title><style><!--H1
{font-family:Tahoma,Arial,sans-serif;color:white;background-coloremoticon525D76;font-s
ize:22px;} H2 {font-family:Tahoma,Arial,sans-serif;color:white;background-color:
#525D76;font-size:16px;} H3 {font-family:Tahoma,Arial,sans-serif;color:white;bac
kground-coloremoticon525D76;font-size:14px;} BODY {font-family:Tahoma,Arial,sans-serif
;color:black;background-color:white;} B {font-family:Tahoma,Arial,sans-serif;col
or:white;background-coloremoticon525D76;} P {font-family:Tahoma,Arial,sans-serif;backg
round:white;color:black;font-size:12px;}A {color : black;}A.name {color : black;
}HR {color : #525D76;}--></style> </head><body><h1>Estado HTTP 404 - Could not f
ind resource for relative : /import/testcase/xlsx of full path: http://localhost
:18080/klaros-web/seam/resource/rest/import/testcase/xlsx?config=P000023</h1><HR
size="1" noshade="noshade"><p><b>type</b> Informe de estado</p><p><b>mensaje</b
> <u>Could not find resource for relative : /import/testcase/xlsx of full path:
http://localhost:18080/klaros-web/seam/resource/rest/import/testcase/xlsx?config
=P000023</u></p><p><b>descripci+¦n</b> <u>El recurso requerido no est+í disponib
le.</u></p><HR size="1" noshade="noshade"><h3>Apache Tomcat/7.0.47</h3></body></
html>* Connection #0 to host localhost left intact



After that I reviewed the P000023, and the Test Case was not imported. I don't know what the problem is??? Please help me. Give more information or examples about it.


PD: I attached Formato_TC.xlsx file and logs of cmd


Thanks in advance

Angel Hidalgo
thumbnail
Torsten Stolpmann, modified 10 Years ago.

RE: Import Test Cases from Excel

Jedi Council Member Posts: 755 Join Date: 2/12/09 Recent Posts
Hi Angel,

I think there is a typo in your URL, you should use http://localhost:18080/klaros-web/seam/resource/rest/import/testcase/xls?config=P000023 instead (xslx -> xsl).

Hope this helps,

Torsten
thumbnail
Angel Guillermo Hidalgo, modified 10 Years ago.

RE: Import Test Cases from Excel

Padawan Posts: 62 Join Date: 12/20/13 Recent Posts
Hi Torsten,


Actually my excel file was done in Excel 2010, for that reason I have .xlsx extension.


I have changed the extension file to .xls. After that I have typed this command:


C:\Users\angel.hidalgo\Documents\Instaladores\Klaros>curl -v -T Formato_TC.xls "http://localhost:18080/klaros-web/seam/resource/rest/import/testcase/xls?config=P000023"


I got this:


Tomcat result:


2014-01-09 08:34:49: ERROR, de.verit.klaros.web.servlet.importer.testcase.XMLTestCaseImportServlet Authentication error - a username and password is required


CMD result:


* Adding handle: conn: 0xb23140
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0xb23140) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 18080 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 18080 (#0)
> PUT /klaros-web/seam/resource/rest/import/testcase/xls?config=P000023 HTTP/1.1

> User-Agent: curl/7.33.0
> Host: localhost:18080
> Accept: */*
> Content-Length: 30208
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
< HTTP/1.1 400 Petición incorrecta
* Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
< Set-Cookie: JSESSIONID=4858CD961A09BB45629E96D8964EDE2C; Path=/klaros-web/; Ht
tpOnly
< Content-Type: */*
< Transfer-Encoding: chunked
< Date: Thu, 09 Jan 2014 13:34:49 GMT
< Connection: close
<
Authentication error - a username and password is required
* we are done reading and this is set to close, stop send
* Closing connection 0



It asked for an authentication, but I don't understand because the project is opened.


Please help me.


Thanks in advance,

Angel Hidalgo
thumbnail
Torsten Stolpmann, modified 8 Years ago.

RE: Import Test Cases from Excel (Answer)

Jedi Council Member Posts: 755 Join Date: 2/12/09 Recent Posts
Hi Angel,

Your project is secured against unauthenticated access in your project settings.

You need to provide your username and password to authenticate at the import REST interface. Please refer to http://www.klaros-testmanagement.com/files/doc/html/User-Manual.Import-Export.html#User-Manual.Import-Export.TestResultImport for an example.

Regards,

Torsten
thumbnail
Angel Guillermo Hidalgo, modified 10 Years ago.

RE: Import Test Cases from Excel

Padawan Posts: 62 Join Date: 12/20/13 Recent Posts
Hi again Torsten,

Thanks for your support.

I disabled Authentication requiered for import option. Then I typed


C:\Users\angel.hidalgo\Documents\Instaladores\Klaros>curl -v -T Formato_TC.xls "http://localhost:18080/klaros-web/seam/resource/rest/import/testcase/xls?config=P000023"


But now I got this:


* Adding handle: conn: 0x8c3140
* Adding handle: send: 0
* Adding handle: recv: 0
* Curl_addHandleToPipeline: length: 1
* - Conn 0 (0x8c3140) send_pipe: 1, recv_pipe: 0
* About to connect() to localhost port 18080 (#0)
* Trying 127.0.0.1...
* Connected to localhost (127.0.0.1) port 18080 (#0)
> PUT /klaros-web/seam/resource/rest/import/testcase/xls?config=P000023 HTTP/1.1

> User-Agent: curl/7.33.0
> Host: localhost:18080
> Accept: */*
> Content-Length: 30208
> Expect: 100-continue
>
< HTTP/1.1 100 Continue
< HTTP/1.1 500 Error Interno del Servidor
* Server Apache-Coyote/1.1 is not blacklisted
< Server: Apache-Coyote/1.1
< Set-Cookie: JSESSIONID=5C7FE1401F2FF88B89ED57BDF3942A3F; Path=/klaros-web/; Ht
tpOnly
< Content-Type: */*
< Transfer-Encoding: chunked
< Date: Thu, 09 Jan 2014 14:17:49 GMT
< Connection: close
<
Import action failed: de.verit.klaros.exception.KlarosUnexpectedRuntimeException
: Unexpected runtime exception: No system user present in the database - unable
to import* we are done reading and this is set to close, stop send
* Closing connection 0



Again I got problems. Do you know why does it happen?

Thanks in advance.


Angel Hidalgo
thumbnail
Torsten Stolpmann, modified 10 Years ago.

RE: Import Test Cases from Excel (Answer)

Jedi Council Member Posts: 755 Join Date: 2/12/09 Recent Posts
You have deleted or disabled the 'system' user account which is the default creator of the imported test cases if you do not provide the credentials of a valid user via username/password attributes.

Regards,

Torsten
thumbnail
Angel Guillermo Hidalgo, modified 10 Years ago.

RE: Import Test Cases from Excel

Padawan Posts: 62 Join Date: 12/20/13 Recent Posts
I am stuck. My current configuration is showed on the picture attached <System configuration.png>

My user name is a_hidalgo
My password is admin

I saw the help in http://www.klaros-testmanagement.com/files/doc/html/User-Manual.Import-Export.TestResultImport.html


Following the example, I have



C:\Users\angel.hidalgo\Documents\Instaladores\Klaros>curl -v -T Formato_TC.xls "http://localhost:18080/klaros-web/seam/resource/rest/import/testcase/xls?config=P000023&username=a_hidalgo&password=admin"


I got this:

No project configuration found for P000023* Closing connection 0


But my project is opened. what do I need to do??


Thanks in advance,

Angel Hidalgo
thumbnail
Torsten Stolpmann, modified 10 Years ago.

RE: Import Test Cases from Excel

Jedi Council Member Posts: 755 Join Date: 2/12/09 Recent Posts
Your project id is P00023 - not P000023.
thumbnail
Angel Guillermo Hidalgo, modified 10 Years ago.

RE: Import Test Cases from Excel

Padawan Posts: 62 Join Date: 12/20/13 Recent Posts
Ohhhhh, so sorry. I changed it and it got this result:

We are completely uploaded and fine.

It is great. Thanks for your patience

Now I have 3 more questions:

1. How to update the project to see the Test Cases imported?

2. Is it posible to import test cases in Klaros Community Edition?

3. Is it necessary to install Jenkins/Hudson Plugin for Klaros-Testmanagement?


Thanks in advance for your answers.


Angel Hidalgo
thumbnail
Torsten Stolpmann, modified 10 Years ago.

RE: Import Test Cases from Excel (Answer)

Jedi Council Member Posts: 755 Join Date: 2/12/09 Recent Posts
It is great. Thanks for your patience


Good to hear, you're welcome.

1. How to update the project to see the Test Cases imported?


They are automatically available and should appear at the next page render of the project.

2. Is it posible to import test cases in Klaros Community Edition?


Yes.

3. Is it necessary to install Jenkins/Hudson Plugin for Klaros-Testmanagement?


No. You use that only if you intend to have Jenkins automatically push test case results for the tests it executed.

Hope this helps,

Torsten
thumbnail
Angel Guillermo Hidalgo, modified 10 Years ago.

RE: Import Test Cases from Excel

Padawan Posts: 62 Join Date: 12/20/13 Recent Posts
Thank you Torsten, but I have still problems updating Test Case, which was imported from Excel. I can't see it into the project.


They are automatically available and should appear at the next page render of the project.



I did that, but I didn't get good results. Do I have to set any additional parameter in the project??

Thanks in advance.
thumbnail
Torsten Stolpmann, modified 10 Years ago.

RE: Import Test Cases from Excel

Jedi Council Member Posts: 755 Join Date: 2/12/09 Recent Posts
Possibly nothing was importing as the document or the format may not have been properly recognized.

I added a working sample in Excel 2003 for your reference.

Regards,

Torsten
thumbnail
Angel Guillermo Hidalgo, modified 10 Years ago.

RE: Import Test Cases from Excel

Padawan Posts: 62 Join Date: 12/20/13 Recent Posts
You are right Torsten,

I have uploaded your file and it works.

After that I created a new excel file with the same characteristics than yours, but it doesn't work. I guess you need a special settings in the file, which are not specified in user manual.

I attached my file.

PD: I just note one difference between them. My file is weighting 29.5KB and yours is weighting 7.5 KB, but the content is the same. I don't understand it.


Regards,

Angel Hidalgo
thumbnail
Torsten Stolpmann, modified 10 Years ago.

RE: Import Test Cases from Excel

Jedi Council Member Posts: 755 Join Date: 2/12/09 Recent Posts
Now that was an interesting one to debug ...

Your Excel-Sheet contains the word Step instead of Step (notice the trailing blank) at the position A:25.
This leads to ignoring this complete worksheet as this word is the detection trigger.

I opened and implemented Enhancement KLAROS-2112 to trim whitespace here just in case that this will happen again to others.

Interesting enough, this trailing blank seems only to appear with stylesheets written by Excel itself. After loading and saving your example with LibreOffice the cell A:25 was automatically trimmed and written in a parseable format.

Removing the trailing blank should get you on track again.

Have a nice weekend,

Torsten
thumbnail
Angel Guillermo Hidalgo, modified 10 Years ago.

RE: Import Test Cases from Excel

Padawan Posts: 62 Join Date: 12/20/13 Recent Posts
You are absolutely right Torsten. Thank you so much.

I deleted that additional space after <Step> and it works.

But I guess, this issue should be improved, because when people create a new file in Excel, they could add this space while they write.

Additionaly, in the user manual you don't have enough information to import test cases succesfully from excel. Without your help I hadn't got good results. I recommend to you to include more information about it.

Also in user menu in curl command to import Test Cases you are using <'>, but I got errors. I typed <"> and it works well. You should change it.

I am going to test more functionalities of Klaros because we are planning to use it in our enterprise. If I find more problems I will write to you. I hope your support.

Thanks for everything. Have a nice weekend too.

Angel Hidalgo
thumbnail
Torsten Stolpmann, modified 10 Years ago.

RE: Import Test Cases from Excel

Jedi Council Member Posts: 755 Join Date: 2/12/09 Recent Posts
The manual has been updated with additional information regarding test case import from Excel.

Thanks for the pointer!

Regards,

Torsten
thumbnail
Angel Guillermo Hidalgo, modified 10 Years ago.

RE: Import Test Cases from Excel

Padawan Posts: 62 Join Date: 12/20/13 Recent Posts
Yes, I noticed that. It's excellent.


Thanks for including my comments.


Regards,

Angel Hidalgo
thumbnail
Angel Guillermo Hidalgo, modified 10 Years ago.

RE: Import Test Cases from Excel

Padawan Posts: 62 Join Date: 12/20/13 Recent Posts
Hi

Again, I got troubles importing test cases from excel. I got this message at the end of importing:

[Aborting import of sheet Formato_TC due to missing definition of user defined property Category, Aborting import of sheet Formato_TC due to missing definitionof user defined property Cycle]* Closing connection 0

Please help me.

Thanks in advance

Angel Hidalgo
thumbnail
Angel Guillermo Hidalgo, modified 10 Years ago.

RE: Import Test Cases from Excel

Padawan Posts: 62 Join Date: 12/20/13 Recent Posts
I have found the problem. When I want to add <Custom Properties> like in <User manual>, Cycle and Category, I get the error. I gues this is a bug of you.

Regards

Angel Hidalgo
thumbnail
Torsten Stolpmann, modified 10 Years ago.

RE: Import Test Cases from Excel

Jedi Council Member Posts: 755 Join Date: 2/12/09 Recent Posts
Typing this on my phone so please excuse the brevity.

To import a sheet containing custom properties these have to be defined under the name on the left hand side (e.g. Color) in the project you will like to import them into.

If you leave them out this should work out of the box. If you add them in your sheet make sure they are defined in the project. This is what the error message above is trying to tell you.

So I think this works as expected.

Hope this helps,

Torsten
thumbnail
Angel Guillermo Hidalgo, modified 10 Years ago.

RE: Import Test Cases from Excel

Padawan Posts: 62 Join Date: 12/20/13 Recent Posts
Thanks Torsten,

I included custom property in <user defined> tab. It is working now.

Regards,

Angel