Contributions
Re: Reading files from ProjectFolder Path in testcomplete
Hi. The folder you're trying to reach can be addressed as ..\..\CommonFiles\ Following is how your exampleshould look like: eval(Include("..\\..\\CommonFiles\\common.js")); Don't forget that double backslashes instead of single ones are needed only in contsants (direct assignments) and not needed if passed as KDT parameters or project or suite variables. Regards, Andrey1.4KViews1like1CommentRe: Data-Driven Test. How to handle Tab to next control for fields that are blank
Hi Marsha. Have you tried nothing for empty field check? In KDT it looks like IfVariables.excelData("Field2") Equals nothing Log Message [...] To define nothing in KDT: select Code Expression as value type to compare to and type nothing as piece of code. This example is valid if VBS was chosen as scripting language. null works for empty Excel fields if JS used for scripting.2.2KViews1like7CommentsRe: User Form text of selected item
Hi vik33. When you assignobj_lst_Din.SelCount to variable, the actual value (not reference to) of property (.SelCount) gets copied into variable. That means this variable does not reflect future changes of property value, this is expected behaviour. Here sample of projectwith list box (unfortunately, current forum engine does not allow to attach zips to post directly, I used my MS OneDrive storage; I will delete this link in couple of weeks). Click handler works perfectly well (I used your cycle in composition of selected items list). Regards, Andrey2.2KViews2likes1CommentRe: Runtime Error when opening and closing Excel Spreadsheet continuously
Hi. Try not to recreate new connection toExcel everytime you need it. You may create it once and assign to global (project) variable. e.g.: 'do it once in your project set Project.Variables.xlobj= Sys.OleObject("Excel.Application") Set workbookObj=Project.Variables.xlobj.Workbooks.Open(Project.Path + "\Data_Input\Data_Input.xlsx") [ some code] Project.Variables.xlobj.WorkbookObj.Close() 'close workbook but don't "close" Excel itself (project variable which keeps connection still valid, you may reuse it for another workbook processing) I use similar approach in my projects, I generate hundreds of workbooks without single issue. Sorry if I've made mistakes in VBS syntax, I use JS.905Views1like1CommentRe: FileExists aand FindFiles failed when No file in Folder TestComplete
Hi. Here is working piece of code. Sub testFiles Dim countFiles Set countFiles = aqFileSystem.FindFiles("C:\Temp\" , "*.zip" ) If countFiles Is Nothing Then Log.Message ( "No files found" ) Else For I = 0 To countFiles.Count - 1 Log.Message( countFiles.Item( I ).Name ) Next End If End Sub1.2KViews1like0CommentsRe: How to call a function in VB script. The function name is in some variable.
Try Runner.CallMethod Here is example of function calling using variable as name Function LogMe( SomeText ) Log.Message( "I'm here!" & " " & SomeText ) End Function Function StartMe Dim FunctionName FunctionName = "Unit1.LogMe" ' full notation of function to be called: unit and name Runner.CallMethod FunctionName, "Say This!" End Function The only drawback of this solution is that you have to specify unit name where your function is stored. More detailed description of this method is here.1.1KViews0likes0CommentsRe: Changing Window Title breaks test
Hi Andrew. Have you checked name mapping? Most likely the window you changed title of was used in name mapping with certain caption (title) value. Double click NameMapping component in you project, find mapped window and check (on right pane) which properties TestComplete uses to recognize your window. Use Object Spy to get properties of your new window and remap it (you may simply remove old properties in name mapping and add new one(s) or manually edit value of property (new name of caption/title). You may also change the way TC recognizes you window deleting caption and adding "required children" set of nested objects specific to this window only.828Views2likes0CommentsRe: Adding component in userform from a script file
As compromising solution I can suggest to create a form with "repository" with excessive number of all possible elements which may require (to cover maximum demand). All elements which not needed for specific situation can be disabled and hidden or moved out beyond of visible part of the form. Other controls can be resized/arranged on form using script depending of set of [Excel] parameters.897Views1like0Comments