Contributions
Re: Unit Testing of jscript library
Hi Allen, Thank you for your response. Perhaps, I'm not clear, but my question is How to configure TestComplete Unit Testing to unit test a TC Project made simply of jscript. I have TCprojects made of jscript functions used as library which are referenced inother projects and included using USEUNIT. What i want to do is to add a unit test item on those "library"projects so that i can unit test the featured offered bythem. But the process of configuring a unit test forces us to indicate the path of an executable. In my case, i have no exe. I just have script files. Regards,677Views0likes0CommentsRe: Dynamically change the Application path between 64 vs 32 bit machines
Hi, Here is a jscript function that must be called before the use of TestedApps variable. As the TestedApps.tcTas file may be saved after execution, i change the path of the tested application in the two direction so that i don't matter the os of the last execution : I f i run the test on 64 bits os, i change to Program Files (x86) else i change to Program Files function ChangeAppPathNameOs() { var application,index; var os64bits = Sys.OSInfo.Windows64bit; if (os64bits) { for ( index=0;index<TestedApps.Count;index++) { application = TestedApps.Items(index); application.Path = application.Path.replace('Program Files\\','Program Files (x86)\\'); } } else { for ( index=0;index<TestedApps.Count;index++) { application = TestedApps.Items(index); application.Path = application.Path.replace('Program Files (x86)\\','Program Files\\'); } } }1.9KViews0likes0CommentsUnit Testing of jscript library
Hi, How to configure Unit Testing in order to test jscript libraries. I have several Unit libraries written in Jscript , and i would like to add TCUnitTest item. The problem is that you must specify a process. In my case, i have no process. regards,9.1KViews0likes3CommentsRe: Pasing arguments to testexecute command line
it seems there is a bug in the way flags are interpreted on the command line .(at least in testexecute 7.52) all flags placed after the /exit files are not taken into account. by example if you place /SilentMode before /exit then tc will be excuted in silent mode whereas in the contrary if you place /exit before /SilentMode then tc will not be executed in silent mode. it is the same with custom flags even using ParamStr. In the documentation, the flag /Silentmode is placed after /exit. Ther is something wrong somewhere. TestExecute.exe[file_name][/run [(/project:project_name)|(/project:project_name/projectitem:item_name)| (/project:project_name/unit:unit_name/routine:routine_name)] [/exit][/SilentMode] regards, Karim SOUAK.2.5KViews0likes0CommentsRe: Pasing arguments to testexecute command line
thank you Jared,, here is a snippet of code for those interested in (totaly free). I use a flag "/arg" to recognize that it is an argument passed from the command line I use this args to create/update projectsuites variables value, but you can do whatever you want. // // handle arguments passed on the command line // the command line is in the form: // "%ProgramFiles%\Automated QA\TestExecute 7\Bin\TestExecute.exe" <PJS File> /run /project:<project> /unit:<Unit> /routine:handleArguments /arg:S:Solution="FMFI" /arg:S:SgbdType="Oracle" /arg:S:IniFile="fileini.txt" /exit /SilentMode // args can be already defined in the projectsuite or are added if they do not exists. // args are defined by the /arg:<Type>:<Name>=<Value> // Type can be S(string)|I(integer)|D(double)|B(boolean) // the flag /exit must be passed after tha /arg flag. function handleArguments() { var max=BuiltIn.ParamCount(); var i,tabVar,str; var varType = new Array(); var re = new RegExp("[:=]","g"); // define the type of variable varType['S']='String'; varType['B']='Boolean'; varType['D']='Double'; varType['I']='Integer'; // for each param for (i=0;i<max;i++) { str = BuiltIn.ParamStr(i); // if it is an /arg flag if(str.indexOf('/arg')!=-1) { // Split the flag to get type, name and value of the variable tabVar=str.split(re); // if the variable is unknown, add it if (!ProjectSuite.Variables.VariableExists(tabVar[2])) ProjectSuite.Variables.AddVariable(tabVar[2],varType[tabVar[1].toUpperCase()]); // set its new value eval('ProjectSuite.Variables.'+tabVar[2]+'="'+tabVar[3]+'"'); } } // this list the default and the local value of the projectsuites variables max=ProjectSuite.Variables.VariableCount; for (i=0;i<max;i++) { // this is the default value BuiltIn.ShowMessage('Default :'+ ProjectSuite.Variables.GetVariableName(i)+'='+ProjectSuite.Variables.GetVariableDefaultValue(i)); // this is the local value BuiltIn.ShowMessage('Local :'+ ProjectSuite.Variables.GetVariableName(i)+'='+eval('ProjectSuite.Variables.'+ProjectSuite.Variables.GetVariableName(i))); } }2.5KViews0likes0CommentsRe: TestItem on projectSuite from script
Hi Jared, thank you for your response. Could it be added as a feature request ? In fact, the Request should be "to be able to manipulate projectsuite as projects." -> we cannot group item on project suites whereas we can do it in projects -> we cannot manipulate projectssuite's items from script whereas we can do it in projects Regards, Karim SOUAK.1KViews0likes0CommentsPasing arguments to testexecute command line
Hi, I would like to be able to pass arguments to unit routine from the testexecute command line. I have many variables to set depending on the kind of test i want to make: All the variables can be stored in a file, but how to pass the name/path of the file to a routine from the testexecute command line in order to update projectsuites variables in the routine Regards, Karim SOUAK.15KViews0likes5CommentsDelphi VCL Object TStatusBar and TVirtualStringTree TChart
Hi, I would like to know how to get the information displayed on a TVirtualStringTree. I can see only the number of RootNodeCount, but how to get the element displayed. Same question on the TStatusBar. I can see the number of element wPartCount, but when i try to acces the element using wText(n), i cannot get the text displayed. Same question on TChart object. Regards.23KViews0likes10Comments