Contributions
ADO Connection Rows Affected by Stored Procedure
I have a script in JScript where I run a stored procedure on a test database, but I want to be able to print the rows affected messages from SQL into the log after running. I have tried a few different methods to obtain the rows affected text, but I have not been able to make any work properly. This is how i established my connection var SprocName = spName var dbname = '888800'; var RowCount; var connectionstring = ADO["CreateADOConnection"](); connectionstring["ConnectionString"] = "Provider=SQLOLEDB.1;Integrated Security=SSPI;Persist Security Info=False;Initial Catalog=DB;Data Source=DBServer"; connectionstring["LoginPrompt"] = false; connectionstring["Open"](); var Cmd = ADO.CreateADOCommand(); Cmd.ConnectionString = connectionstring["ConnectionString"]; Cmd.CommandType = adCmdStoredProc; Cmd.CommandText = SprocName; var oParmSP = Cmd["Parameters"]["CreateParameter"]("intappid", ftString, adParamInput, "10", dbname); var RecSet; var Roweffect; var RecordsAffected; var params = new Array(); params.push(RecordsAffected); params.push(Cmd["Parameters"]["ParamValues"]("intappid")); var result = OutParameterWrapper.CallObjectMethod(Cmd, "Execute", params).toArray(); Log.Message(result[0]); I am using the OutParameterWrapper script extension mentioned in an earlier thread which posed a similar question a few years ago. I think where I am stuck is actually getting the Command to execute properly from the CallObjectMethod and setting it up so that I actually get the rows affected value. It has been difficult to find actual coding examples of finding the information I need or setting up the execute call properly. Any help or suggestions will be appreciated.643Views0likes0CommentsRe: TestComplete Application Closes on Script run
So it turns out the issue has stopped happening. Not sure what it could have been, most I did was close a few script tabs, saved, closed without running a script, re-open TC, make an edit and save, and scripts run without a problem now.1.2KViews0likes0CommentsRe: TestComplete Application Closes on Script run
The source control we use for our scripts is Tortoise GIT, and a current pull shows what I am using is up to date, and through looking the files over I don't seem to missing anything. Disable Mouse is also not enabled for any of my projects. I have tried running both the full project of test scripts as well as individual scripts by opening the script and pressing the run button. Running TC as an admin also did not do anything to help, I was hoping I could at least get an error message out of it.1.2KViews0likes1CommentTestComplete Application Closes on Script run
Today I booted up TC to start testing some error handling for my test scripts and I ran into something I haven't seen before. Regardless of what script I try to run, TC will minimize and display the playback window like normal, but none of the script actually gets executed. I cannot press the Pause or Stop buttons, and after about a minute or so, TC will just close, no error report to send or anything. I am on version 12.10.590.7 and have checked for any available updates. My scripts have also not changed since Friday when I last updated some and ran them. With no error messages I am stumped as to what could be causing this, has anyone experienced the same thing or something similar?1.2KViews0likes4CommentsRe: Catching Exception for Object Click
Would I be able to use a While loop during all my function calls? I would prefer to umbrella all the function call checking under 1 conditional as opposed to calling an IF after every function call, since some scripts can have upwards of 30 calls. Would something along these lines work? MyScript() { while(successful != false) var successful = functioncall1() var successful = functioncall2() var successful = functioncall3() }1.9KViews0likes4CommentsCatching Exception for Object Click
I am trying to add some error handling and tear down functions into my current test scripts. I can't seem to understand how to properly use the try catch block to initiate tear down functions when a web object cannot be found. Here is an example of what I am trying to do try { var browser = Sys.Browser("*"); var Page1 = browser.Page("*"); props = new Array("contentText", "className", "Visible", "VisibleOnScreen"); values = new Array(categoryname, "categoryButton", true, true); var category = Page1.FindChild(props, values, 30); category.Click(); Page1.Wait(); } catch (error) { Log.Error("Category group error occured"); ClickMyAccount(); Logoff(); } I found out that if an object is not found, TestComplete does not throw an exception which can be caught, so I am unsure how to proceed from here. I also have debug agent enabled for my projects. Any suggestions would be appreciated.1.9KViews0likes8CommentsRe: Excel.ActiveWorkBook.WorkSheets is not a function
Using .Item seemed to do the trick. Next problem I am facing now is that using that pathway, I do not have access to the Cells function for the worksheet as shown in my code here where I populate my array with the data found in the given row of the worksheet. for(var colcounter = column; colcounter <= colend; colcounter ++) { var testcell = VarToStr(xlsheet.Cells(row, colcounter).Value); rowdata[arraycounter] = testcell; arraycounter +=1; } Using the Item object does it have a similar function to get cell data?1KViews0likes2Comments