java - Selenium database test fails when executed using ant script -


I have a Selenium WebDriver test that connects to a database, executes queries and values ​​stored in the string Does. Then I do stuff with that thing

When I execute the test in Twist (based on Eclipse) this test works fine.

But when I execute the test using an ant script, it is also seeing that the faucet indicates the exception is failing. [Twist.runner] java.lang.ClassNotFoundException: com.microsoft.sqlserver.jdbc SQL LarsworthDrive

Code Snippets:

  Verify Public Zero user-verifiedTTLUser profiles and subscriptions () throws an exception {string user information = products. VerifyTrue ("Manually did not match user details in the subscription table, check manually", userDetails.contentEquals ("1215401")); } Verify public static strings Subscriptions to the devices () throws IOException, SQLException {String userSubscriptionDetails = null; DBAccess.getConnection (ConnectionStrings.databaseConnect ("Authentication"), ConnectionStrings.getLoginDetailsDB ("user name"), ConnectionStrings.getLoginDetailsDB ("password")); Statement stmt = DBAccess.con.createStatement (); Results Results = stmt.executeQuery (ConnectionStrings.getSqlQuery ("Verify Subscription")); While (result.next ()) {userSubscriptionDetails = result.getString ("ServiceID") + result.getString ("status") + result.getString ("AutoRenew"); } DBAccess.closeConnection (); Return user membership; description; } Public class DBAccess {public static java.sql.Connection con = null; Public static java.sql Connection Mill Connection (string conurl, string username, string password) {try {class.forName ("com.microsoft.sqlserver.jdbc.SQLServerDriver"). NewInstance (); Con = java.sql.DriverManager.getConnection (conurl, userName, password); If (con! = Null) System.out.println ("Connection successful!"); } Hold (exception e) {e.printStackTrace (); System.out.println ("Error in trace (getConnection):" + e.getMessage ()); } With return; } Public stable string database throws connection (string connection) IOException {string conurl = null; String url = "jdbc: sqlserver: //"; Switch (connection) {case "authentication": if (in the configuration .getSqlServerName (.) ("Step")) {conurl = url + "tslauthentication.database.ST.tslweb.local"; break; } Else if (! Configuration.getSqlServerName (.) Contains ("step")) (conurl = url + configuration.getSqlServerName ()); break; } And break; Case "tes_connect": conurl = url + configuration.getSqlServerName () + ".tslwebdev.local" + ":" +1433 + "; Database Name =" + "tes_connect" + "; Select method =" + "Cursor" + ";"; break; } Connection = Concurrent; Return connection; }   

Error returned by anint:

java.lang.NullPointerException test.products.NewUser subscriptions Verify user: java.util.concurrent.FutureTask.run at java.util.concurrent.Executors $ RunnableAdapter.call (executors.java:471) on user-created intsl user profile and subscription letter (newuser memberships.java: 68) java In .itil.concurrent.ThreadPoolExecutor.runWorker (ThreadPoolExecutor Java: 1145)

Fool is really JDBC By adding the driver to the squares, it managed to recover.

Comments

Popular posts from this blog

php - PDO bindParam() fatal error -

logging - How can I log both the Request.InputStream and Response.OutputStream traffic in my ASP.NET MVC3 Application for specific Actions? -

java - Why my included JSP file won't get processed correctly? -