Contributions
Re: Can TestComplete sniff ethernet / USB traffic?
Simplest what I found was using netstat -e shell command and processing its output. It will not give you information on specific proccess however, just on general traffic. Function below works for English WIN 8.1 Function NetStat_win8 Dim strLine Dim varMBIn, varMBOut strLine = getCommandOutput("netstat -e") strLine = Left(strLine,InStr(strLine,"Unicast") - 1) strLine = Ltrim(Right(strLine,Len(strLine) - InStrRev(strLine,"Bytes") - 4)) varKbIn = Left(strLine,InStr(strLine," "))/1024 varKbOut = Ltrim(Right(strLine,Len(strLine) - InStr(strLine," ")))/1024 log.Message varkbIn &"/" & varkbOut NetStat_win8 = Array(varkbIn,varkbOut) End Function1.9KViews0likes0CommentsRe: On Error Call
VBS does not suport ErrorHandlers, and only options available are on Error ResumeNext and On Error Goto 0. However there is a solution - EventHandlers which I ignored so far: http://support.smartbear.com/viewarticle/55502/ I added EventHandler 'OnLogError': 'USEUNIT CommonScripts 'CommonScripts unit contains Subs and Functions used by other units, including MailErr and KillThemAll Sub Sub GameOver_OnLogError(Sender, LogParams) 'Take a screen shot of the active window. Set Wshshell=CreateObject("Word.Basic") WshShell.sendkeys"%{prtsc}" 'Send Keys seems to fail without a Proper Delay Delay(500) 'Create PictureObject from Clipboard Set PicObj = Sys.Clipboard Call PicObj.SaveToFile("C:\ErrorPics\LastError.png") 'Send Email about error with prontscreen attached Call MailErr(LogParams.AdditionalText, "GAME OVER - " & LogParams.MessageText) 'Kill all trash processes that might remain after error was logged Call KillThemAll 'Stop Runner.Stop(True) End Sub496Views1like0CommentsOn Error Call
Hi, I am using VBS to script my scenarios. TC works on remote machine and reports me in realtime withemailscases when results are different from expected. I run about 300 cases daily and want to concentrate on importantcasesonly. I have problems with cases when TC fails to get throgh the whole scenario - test fails with an error (overlapping windows, no object found ortested application fails with a fatal error). Of course there isinfo is the tests' log, but I created mail reports to avoid reading throgh 300 cases logs. Which cannot be reached while tests are going on anyway(12 hours or so, 5 am - 5pm). Is there a way in TestComplete to force calling an 'error procedure' when there is error logged instead stopping / continuing the test? regards Greg1.2KViews0likes1CommentWaitWinFormsObject wait for project's Method invoke timeout instead its own
Hello, I notices that in some cases WaitWinFormsObject pauses the test for project's Method invoke timeout instead for Method's Timeout. I call the method as usual: IF Aliases.MyApp.WaitWinFormsObject("MyForm", 500).Exists then ... end if When there is no "MyForm" TestComplete freezes for 1min (I have project's Method invoke timeout Set for 60000ms) displaying 'waiting for WaitWinFormsObject("MyForm")'. I would expect rather 0,5s freeze. The effect may be bound with CallObjectMethodAsync called just before: 1. I open a Form1 with CallObjectMethodAsync 2. Do some operations on Form1 3. I Close Form1, with CallObjectMethodAsync 4. As result of Form1.Close MyForm may appear. MyForm is modal and close method freezes test until MyForm is closed... that is why I have to use Async call for Form1.Close. Did anyone experienced similar problem? Is there a workaround for it? Can project's Method invoke timeout be changed from script level perhaps? regards Greg1.9KViews0likes2CommentsRe: Bytes sent / received by proccess
Solved: 1. To see TCPView I need launch TC as administrator. Thanks support! 2. To get data from TCView I created function inVBS: Function GetTCPViewData SET APP = NameMapping.Sys.Process("Tcpview").Window("TCPViewClass", "TCPView - Sysinternals: www.sysinternals.com", 1) SET LV = APP.Window("SysListView32", "", 1) SET TB = APP.Window("ToolbarWindow32", "", 1) 'TCPViewer is launchedminimized.Maximize it Call APP.Maximize 'TCPViewer is launched in Pause mode. Refresh it to get data Call TB.ClickItem(4) redim ArrTCP(LV.wColumnCount,LV.wItemCount) For i=0 To LV.wItemCount-1 For k=0 to LV.wColumnCount-1 ' Obtains item caption ArrTCP(k,i) = LV.wItem(i,k) Next Next GetTCPViewData = ArrTCP 'Minimizes TCPViewer to allowTested application to be proccessed Call APP.Minimize END Function1.2KViews2likes0CommentsSript Step-by-Step execution
Hi, is it possible in TCto execute your script in step-by-step mode?Solved2.4KViews0likes2CommentsBytes sent / received by proccess
Hello, I need a solution for checking total amount of bytes sent / received via LAN by tested application (proccess) on Windows 7, virtual machine (Hyper V). At the moment I use netstat - e command (WScript.Shell) but it gives me info on total use of net. Is there a simple method of getting information on single proccess? regards3.2KViews0likes2Comments