'VBS to connect and disconnect network drives.'strPath and strDrive and the shared drive path and the drive letter to be mapped.'Assumption is that the drive letter is valid and does not contain any drives mapped to it already.'Commented line of code can be used to disconnet the mapped network drive.

i=0 'Get the row count from the values retrieved from the databaseiRowCount = 0 Do While Not rs.EOF iRowCount = iRowCount + 1 rs.MoveNext Loop If iRowCount = 0 then MsgBox "No rows found" else fldCnt= rs.fields.count rs.MoveFirst Do While Not rs.EOF For j= 0 To fldCnt-1 GData(j) = trim(rs.Fields(j).Value) MsgBox GData(j) Next 'Navigating to the next row in the database result set. rs.MoveNext Loop

Topics: Application Error, Dr. Watson, GPF, Hang, Freeze, CrashRecognition and Interaction with Web Objects (DOM, HTML, etc.)Interaction with the System EnvironmentOS: Windows Platform Not RelevantCreation Date: 27 Jul 2004Last Modified Date:19 Aug 2007Problem Description: System resources problems and errors occur while testing Web applicationsOccasionally, some users testing Web applications experience erratic problems related to system resources that can only be recreated in their own environment. This is normally experienced on really long test runs that consume a lot of system resources and eventually produce strange and erratic behavior that can include:· Random errors or warnings,· Crashing of IE, Quicktest, other apps or Windows,· Corrupted data tables, or· Corrupt data entered into app under test.Solution: Optimize the system environment and minimize IE periodically during the test runFirst, try to optimize and simplify your system environment as much as possible (i.e., ensure a lot of free space on the C:\ drive, reinstall your Service Pack, run Windows Update, try the script on another workstation, unload all unnecessary add-ins and applications, run all resources from local hard drive, etc).If the problems continue, minimizing and restoring the browser window from within the script may help. It has been found that minimizing, then restoring the browser window tends to free resources used by IEXPLORE.EXE (and possibly QTPro.exe). It should be noted that to do this on replay, calling the .Minimize method will not free the resources, but using device replay to click a position relative to the window (where the minimize button is) will. This method can be used to help prevent exhausting system resources on replay of demanding tests.Note:The increase of memory usage with IEXPLORE.EXE can be seen without QuickTest Professional. When QuickTest Professional is used to replay against a Web application, the memory usage can increase at a faster rate.The custom function below can be helpful in many cases. Note that this is provided to try but is not guaranteed to work in all situations.1. Copy the function definition to a .vbs library file. For more information on working with a Function Library, refer to Problem ID 26025 - How to create a VBScript library file and Problem ID 22314 - How to load a VBScript library file for use with a script.' ** Function Definition **Function FreeIEResources (BrowserTitleIn) dim WinObj, absx, absy, width1, obj Set WinObj = Description.Create() WinObj("title").Value = BrowserTitleIn WinObj("index").Value = 0 absx = Browser(WinObj).GetROProperty("abs_x") absy = Browser(WinObj).GetROProperty("abs_y") width1 = Browser(WinObj).GetROProperty("width") Set obj = CreateObject("Mercury.DeviceReplay") 'obj.MouseMove absx+width1-50,absy+10 'wait 1 obj.MouseClick absx+width1-50,absy+10, 0 ' Note:This function is not part of QuickTest Professional. It is not guaranteed to work and is not supported by Mercury Customer Support. You are responsible for any and all modifications that may be required.If the browser does not minimize and restore when you execute the function, you may need to adjust the coordinates used to find the browser's minimize button. The line that will need to be modified is indicated above. You can use the MouseMove method to test the coordinates. Only the part of the first argument (absx+width1-50) should need to be adjusted.2. Load the .vbs function library for use with the script.3. Call the function from within your script.Example:dim BrowserTitleBrowserTitle = "Yahoo!.*"FreeIEResources (BrowserTitle)' ORFreeIEResources ("Google.*")Note:A regular expression can be used to for the Browser title. For more information on using regular expressions, refer to Problem ID 6069 - How to use regular expressions (or wildcards).Place a call to the function in your script well before you feel you may need to free system resources. For example, if you are running several loops, it could be placed at the end of each loop.An example test script is attached. When you run the test script, you will need to have the Task Manager open to the Processes tab.

'*****************************************************************************************************' Open the Excel File using the object created'*****************************************************************************************************'

'*****************************************************************************************************'Kill all the open Excel Process'*****************************************************************************************************'

'*****************************************************************************************************'Terminate all the object created'*****************************************************************************************************'

'*****************************************************************************************************'Read data from excel file and create an input array with all expected results'*****************************************************************************************************'

'*****************************************************************************************************'Upload the array elemenrts obtained from the Excel into the Quality Center.'*****************************************************************************************************'