Contributions
Re: How to execute a SQL insert from TC 9
Try using a different ADO object instead of the query object - ADO Command is what I use for inserts. Assuming the file you open has an INSERT INTO statement in it, try the following. var sql_statement = aqFile.ReadWholeTextFile("Q:\\Insert_Prenatal_HX.sql", aqFile.ctANSI); var Qry = ADO.CreateADOCommand(); Qry.ConnectionString = "Driver={SQL Server};Server=" + dbServer + ";Database=" + dbName + "; Trusted_Connection=True;"; Qry.CommandText = sql_statement Qry.CommandType = cmdText; Qry.Execute(); Qry.Close(); I've never tried to use RecordCount with an ACO Command object, but since this is an insert you aren't going to get a result set anyway.1.4KViews0likes0CommentsName mapping questions
I did almost all of my mapping of web objects in 8.7 and then upgraded to 9.0. Since then there have been a lot of changes to my projects, but now I need to go back and map a lot more objects in my web application. There are 2 problems I'm facing now - I'm guessing both are just some setting that either changed in the upgrade or I changed without knowing what it did. 1. The default properties used when selecting objects has changed. It used to always use the Name property and sometimes some extra properties. This was perfect for our web app. Now it records the ObjectType and ObjectIdentifier - these do me almost no good. I thought that's what templates were for but I have no experience with templates - and when trying to figure it out I noticed that Name is missing from the list of properties I can use. I'd appreciate any advice on this (either using templates or switching back to using Name as the default property). 2. Mapping objects in my web app has become extremely slow. It used to take maybe a second to map something, now it takes up to a minute. I thought this may have been a problem with my NameMapping file due to some recent problems with it, but even using a new project it is still slow. I know it was fast in 8.7, I know it is slow now - what I don't know is whether it was always slow in 9.0 or if it's something I changed. Anyone else seen this happen or have any guesses of what I can do about it?21KViews0likes0CommentsMemory cleanup in scripts
I'm noticing that the memory usage of TestComplete is fairly consistent with some of my scripts and grows constantly with others, so I probably introduced a memory leak. Does anyone have any information or advice about cleaning up objects or arrays when running scripts? How much manual cleanup is needed for a script that will run through to completion dozens or hundreds of times in a row? It seems like there is a garbage collect happening, but maybe I'm doing something that gets in the way like leaving pointers around. I'm using JScript if that makes a difference, and the only tests I have problems with tend to have arrays, objects, and sometimes arrays of objects.19KViews0likes2CommentsOCR error messages
I'm using the OCR to look for a string that may or may not exist on my page using the FindRectByText method. The script can handle if it is not found and works just fine, but when not found it logs a very generic error. Flagging the whole run as an error makes it easier to miss real errors or warnings. Is there some way to disable the logged error? Or is it possible to customize the message at all (changing the level to warning/message for example)? The text is in an image, so as far as I can tell OCR is my only option. If there's a better or just different way look for text like that I can try it.18KViews0likes1Comment