Contributions
Re: Over Night Test Runs
Hi Daniel, The details on how to organize overnight test runs depend on how your build and test processese organized and test environment. But I'll try to explain in general how to do that. 1) Create a batch file that will execute test (and optinally make some preparation operations like update test sources from version control, copy latest builds, kill existing testexecute processes as they will prevent launching tests etc, you can also addlogoff in the end to completely log off from the test machine after test). 2) create an .rdp file on another machine, it should connect to your test machine via rdp: Start->Run - mstsc, orStart->All Programs ->Accessories -> Remote Desctop Connection. Make all settings you need (mark the password to be saved) and then save the rdp file - 'save as'. Make sure that doubleclicking that file invokes remmote desktop automatically You can just set 'start program on connection' there to launch batch file from the step1, but it didn't work for me everyehere (at least it didn't on Vista and Windows 7 due to some strange bug), so if it won't for you you may use psexec utility to launch process remotely in the rdp session. 3) Create batch file that launches this rdp file, and then (optionally, if 'launch program on connection' won't work) executes your test in remote session interactively with psexec (you should specify correct session number after 'i' parameter there). 4) Put it on schedule e.g using standard windows task scheduler. In my case the tests are triggered from build server after the nightly builds are ready - I made this with a separate automated build studio macro, but that's already another story... Regards, Pavel620Views0likes0CommentsRe: Over Night Test Runs
Daniel, You actualy can initialize tests to be launched in rdp session from a locked PC. that's the way I launch the scheduled tests. You should create an .rdp file with appropriate connection and resolution settings so that it could init the remote sesktop without entering password, set it to execute program on connection and put it on schedule. We have two virtual test machines running tests overnight on schedule in this way from a build server, except for just tests are executed with psexec utility allowing to execute programs interactively in the specified session. Regards, Pavel2.3KViews0likes0CommentsRe: Any suggestions for testing web application which is developed using ExtJS, preferably with TestComplete?
Hi, You should specify the PropertyName and PropertyValue as a strings in waitproperty method. But you won't be able to access childs in this way. You'll be just waiting untill a specified property of the object will obtain the specified value. As for waiting for a specific exjs control to appear I am using function like the following (JScript) to get it by its up to 3 properties: You may convert it to VBS and pass arrays of properties and values to it instead of strings (I guess you won't need any array conversion like it is done in JScript with ConvertJScriptArray function) function CheckChild_(Obj, TimeOut, Property1, Value1, Property2, Value2, Property3, Value3) { var properties, values, child, i=0; properties = new Array(Property1, Property2, Property3); values = new Array(Value1, Value2, Value3); properties = ConvertJScriptArray(properties); values = ConvertJScriptArray(values); while(!Obj.FindChild(properties, values).Exists) { Delay(1000); Obj.Refresh(); i++; if (i>TimeOut) break; } Obj.Refresh(); return Obj.FindChild(properties, values); } Then you can get the element like this, waiting it for 60 seconds: var Obj = CheckChild(ParentObj, 60, "className", "x-panel x-panel-noborder x-border-panel"); if (!Obj.Exists) return false; Obj.Click();1.2KViews0likes0CommentsRe: Any suggestions for testing web application which is developed using ExtJS, preferably with TestComplete?
I'm also automating ExtJS web application with TestComplete. ExtJS controls can be handled as any other. You may use Find or FindAll methods to get them by properties that are not changed dynamically, or create your own functions to search for necessary web elements, or to wait until they will appear. I most cases I can obtain necessary web element just by its classame (excluding dynamic part) and tag name.1.2KViews0likes0CommentsRe: Open Office support
Hi, It is possible to work with Open Office API After getting its two objects "com.sun.star.ServiceManager", and "com.sun.star.frame.Desktop" you can do almost anything with it. Here's an example on how to write some data to Open Office Calc and save the document (JScript): FileName - full path for the new file function SaveSmthToCalc(FileName) { try { //creating Desktop object var oServiceManager = Sys.OleObject("com.sun.star.ServiceManager"); var oDesktop = oServiceManager.createInstance("com.sun.star.frame.Desktop"); // creating an array of document parameters // and placing there a value Hidden=true, so that Open office calc won't be shown var VariantArray = new Array(); var Mystruct = oServiceManager.Bridge_GetStruct("com.sun.star.beans.PropertyValue"); Mystruct.Name = "Hidden"; Mystruct.Value = true; VariantArray[0] = Mystruct; //creating a document //first parameter can be a URL path to an existing document (then existing document will be changed) var oDoc = oDesktop.LoadComponentFromURL("private:factory/scalc", "_blank", 0, VariantArray); //getting first sheet var oSheet = oDoc["getSheets"]().getByIndex(0); //filling several with some values for (var j=0; j<10; j++) for(var i=0; i<10; i++) oSheet.getCellByPosition(i, j).setString("Col:"+i+" Row:"+j); //saving the document // url path should be used here, so converting usual path to it oDoc.storeAsURL("file:///"+aqString.Replace(FileName, "\\", "/"), VariantArray); //closing document oDoc.Close(false); } catch(exception) { Log.Warning("Unable to save the data to ods table", exception.description); } }1.1KViews0likes0CommentsRe: How to Execute command line utilities from within a testcomplete script
Hi You can use WshShell.Run method to run any command line utility and save its return value to variable WshShell = Sys.OleObject("WScript.Shell"); Result = WshShell.Run("YourUtility.exe"); Here's more information about using this method http://msdn.microsoft.com/en-us/library/d5fk67ky(v=VS.85).aspx11KViews0likes0CommentsRe: Global variables in C# Scripts
Hi, You can just declare your variables outside the function in this case. var a,b,c,d; function main() {init();test();} function init() {a=b=c=d=1;} function test() {Log["Message"](a+" "+b+" "+c+" "+d);} If you want to get access to these variables from another script, just add the script with variables declaration to it via //USEUNIT statement.727Views0likes0CommentsRe: Disabling project suite test items
Isn't it really not possible to disable projects from scripts? Had just an idea to modify xml data of .pjs file from script, where information about enabled projects stored (to change "enabled" property for needed item in "test data" node. But such changes will be applied only after reloading the project suite, and not during the current run. So, are there any other solutions for this?917Views0likes0Comments