Ask a Question

Test Complete execution through Jenkins - Database issue

SOLVED
Subbulakshmi
Frequent Contributor

Test Complete execution through Jenkins - Database issue

Hi,

 

I have configured Test complete plugin in Jenkins and able to execute the test cases properly, if the script does not have any database queries. If there is a database query, It is waiting for infinite time. 

The same configuration works in colleague's machine properly and When I execute the test case directly from Test complete, it works fine. 

 

Could you please let me know the issue and work around. 

Regards,
Subbulakshmi
11 REPLIES 11
AlexKaras
Community Hero

Hi,

 

You need to configure database access on the machine where tests are running via Jenkins.

 

Regards,
  /Alex [Community Hero]
____
[Community Heroes] are not employed by SmartBear Software but
are just volunteers who have some experience with the tools by SmartBear Software
and a desire to help others. Posts made by [Community Heroes]
may differ from the official policies of SmartBear Software and should be treated
as the own private opinion of their authors and under no circumstances as an
official answer from SmartBear Software.
The [Community Hero] signature is used with permission by SmartBear Software.
https://community.smartbear.com/t5/custom/page/page-id/hall-of-fame
================================
Subbulakshmi
Frequent Contributor

Hi,

 

I am able to connect to database when I run my testcase from Test complete directly. Only through Jenkins, it is not working. 

Regards,
Subbulakshmi

It might be an access issue.

 

Do you running your tests VM or in local system?


Thanks
Shankar R

LinkedIn | CG-VAK Software | Bitbucket | shankarr.75@gmail.com

“You must expect great things from you, before you can do them”

Extension Available

Subbulakshmi
Frequent Contributor

Hi Shankar,

 

We are using local system. 

Regards,
Subbulakshmi

This sounds like a permissions problem.  Keep in mind, when running tests via Jenkins, the user that executes the test is the user that Jenkins tasks run under.  So, if you are depending upon the existing Windows Authentication of the logged in user to access the database, if your Jenkins user does not have permissions, then the database connection will fail.

Two possible solutions:

1) Allow the user that Jenkins is running under to have access to the database

2) Re-factor your test code and database security to use a "static" login rather than Windows authentication


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Hi,

 

The user is having rights for executing database queries and Database is connected via separate user name and password. 

Regards,
Subbulakshmi

I'd still investigate in that direction.  Add some logging to your project to determine what user name and password is being used to log in to the database during a Jenkins execution.  Something in the execution via Jenkins is not passing in the proper user access.  

 

Can you share or paste the code here that is used for that database connection?


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available

Hi,

 

This is the connection statement we use. 

Conn.ConnectionString ="Provider=MSDASQL;DRIVER=Ingres II Read Only;Data Source=LKK2 AUTO;SERVERTYPE=INGRES;Database=testauto;User ID=lkksql;Pwd=W1llows"

 

But, the same code works in my colleague's machine. All Jenkins configuration is same. 

Regards,
Subbulakshmi

Several possibilities:

 

1) The user running Jenkins does not have access to "see" the server indicated in the connection string

2) Jenkins may be running as 64-bit but the provider/driver is a 32-bit driver


Robert Martin
[Hall of Fame]
Please consider giving a Kudo if I write good stuff
----

Why automate?  I do automated testing because there's only so much a human being can do and remain healthy.  Sleep is a requirement.  So, while people sleep, automation that I create does what I've described above in order to make sure that nothing gets past the final defense of the testing group.
I love good food, good books, good friends, and good fun.

Mysterious Gremlin Master
Vegas Thrill Rider
Extensions available
cancel
Showing results for 
Search instead for 
Did you mean: