Contributions
Re: Running Project test item
//[VBScript] for above function Sub ProjectTestRun test = Project.TestItems.Current.ElementToBeRun.Caption arr = split(test,"\") tempArr=split(Arr(1),"-") unitName = aqString.Trim(tempArr(0)) name = aqString.Trim(tempArr(1)) Runner.CallMethod(unitName + "." + name) End sub4KViews2likes0CommentsRe: Please Help!! Excel problem.
//Code for reading from Excel: function readFromXL(fileName, sheetName, row, col){ try{ var Driver; // Creates the driver // If you connect to an Excel 2007 sheet, use the following method call: Driver = DDT.ExcelDriver(fileName, sheetName,true); //Driver = DDT.ExcelDriver(fileName, sheetName); Driver.First(); var i; for (i=2; i<row; i++){ Driver.Next(); } tmpCol= aqConvert.VarToStr(DDT.CurrentDriver.Value(col)); DDT.CloseDriver(Driver.Name); return tmpCol }catch(e){ Log.Message(e.description); } }1.5KViews1like0CommentsRe: Get the Execution time (Start and End Time)
Hello i need the same along with Test duration Total Project Test Items Executed Project test items Passed and Failed test item count. how to get it from log file [Equivalent VBScript for above example] function getResults() Log.Message "See Information data in the Additional Info panel", getInformationData End function function getInformationData tempFolder = aqEnvironment.GetEnvironmentVariable("temp") & "\" & Int(rnd * 10000) & "\" aqFileSystem.CreateFolder(tempFolder) Log.SaveResultsAs tempFolder, lsXML Set xDoc = Sys.OleObject("MSXML2.DOMDocument.4.0") Call xDoc.load(tempFolder + "Description.tcLog") ' // Warning count wrnC = VarToInteger(xDoc.selectSingleNode("Nodes/Node[@name='root']/Prp[@name='warning count']/@value").text) '//Error count errC = VarToInteger(xDoc.selectSingleNode("Nodes/Node[@name='root']/Prp[@name='error count']/@value").text) ' //Execution time startTime = VarToFloat(xDoc.selectSingleNode("Nodes/Node[@name='root']/Prp[@name='start time']/@value").text) stopTime = VarToFloat(xDoc.selectSingleNode("Nodes/Node[@name='root']/Prp[@name='stop time']/@value").text) aqFileSystem.DeleteFolder tempFolder,true getInformationData = "Errors: " & errC & vblf &_ "Warnings: " & wrnC & vblf &_ "Start Time: " & DateTimeToStr(startTime) & vblf &_ "Stop Time: " & DateTimeToStr(stopTime) & vblf &_ "Run Time: " & aqConvert.DateTimeToFormatStr(stopTime - startTime, "%H:%M:%S") End function5KViews0likes0CommentsRe: Temproary Variables Declaration
Hello, Project has temporary and persistent variable. temporary variable holds value at runtime. where as persistent has value even after test run. so in ur case use temporary variable to acheive the task. To acces project variable from script u can use project.variables.varName=0 To add variables through scripts [VBS] Set Variables = Project.Variables if Not Variables.VariableExists("Var1") then Project.Variables.AddVariable "var1", "Integer" 'datatype End if To remove variable project.variables.removevariable "variablename" See for more info1.7KViews0likes0CommentsRe: Clarification of how to suppress error logging
hi log.LockEvents() only locks the events being posted in TestLog. To handle specfic error u can use something lik this in onlogerror event Sub GeneralEvents_OnLogError(Sender, LogParams) If (LogParams.MessageText = "Object not found") then ' It is an expected error. 'handle error here ' Perform actions that handle this error in the special way else 'do operation EndIf EndSub See for more u can also disble log being posted using Log.enable=False in event handler To handle errors in scripts see for more info1KViews0likes0CommentsRe: WaitProperty("Exists") error message
Hello Wait property only works with objects that exists. to handle object not found error refer link http://support.smartbear.com/viewarticle/56627/ if udont want log to be posted error u can enable dispabe log using log.Enable=False if u r using vbscript thn u can use if object to chek for an object has reference if isObject(objectname) then objectname.waitproperty(propertyname,propValue,Timeout) End if3.6KViews0likes0CommentsRe: Exporting Test Results at end of test
Hi Jose & Gena, your solution works great for a single project execution. but what about executing projectsuite. if there is 2 projects in a projectsuite then first project has its own log exported but second project testlog exported along with 1st project. Executing a 'exportResults' at final project makes single log for all projects which is large in size and extremely slow in opening. is there any way that i can export log separately for each project item in project suite? also if there is any event across project suite then it will be very useful.2.9KViews0likes0CommentsExporting Test Results at end of test
I'm Exporting test results using SaveResultas method. I've implemented in this in On_Stop test event. But Each item it exporting log separately. Say for i've 3 test items in project then 3 Log Results Exported. i need one complete final Test log. On Stop test event raises when each test item execution complete.how to export log whn final item executed. is there anything can be done with itemcount property?3.8KViews0likes9Comments