One Testing Center

QTP - Keyword Driven Framework. QTP Learning Book - Learn By Questions. QTP Learning Book - Made Easy - Part1. QTP Learning Book - Made Easy - Part2. QTP Quality Center - QC.

QTP - Frameworks

QTP - Frameworks. Record and Play back Framework. Action Driven Framework. Data Driven Framework. Functional Decomposition Framework. Keyword Driven Framework. Hybrid Framework. Test Driven Framework.

QTP - Automation

QTP - Basics. QTP - Intermediate. QTP - Advanced. QTP - Frameworks.

QTP - Training

Friends, Welcome to OneTestingCenter. I am HP Functional Test ExportOne. I am HP Automation Functional Test Certified Professional. I am certified for HP Functional Test 11.x. Happy to share my knowledge.

QTP - Books

QTP - Keyword Driven Framework. QTP Learning Book - Learn By Questions. QTP Learning Book - Made Easy - Part1. QTP Learning Book - Made Easy - Part2. QTP Quality Center.

Recent Post

FSO–FileSystemObject (VBScript)

FSO

FileSystemObject

Work with Drives, Folders and Files.

Object heirarchy:

FileSystemObject

FileSystemObject.Drives

FileSystemObject.Drives.item

FileSystemObject.GetFolder
FileSystemObject.GetFile

Once a File System Object has been opened you can use Methods and Properties to work with folders and files:

FileSystemObject Methods:

.BuildPath(strPath, strFileName)

.CopyFile(Source, Dest [,Overwrite (True/False)]

.CopyFolder(Source, Dest [,Overwrite (True/False)]

.CreateFolder(Path)

.CreateTextFile(FileName [,Overwrite (True/False) [, Unicode (True/False)]])

.DeleteFile(FileSpec, Force (True/False))

.DeleteFolder(FileSpec, Force (True/False))

.DriveExists(strDrive) (True/False)

.FileExists(strFile) (True/False)

.FolderExists(strFolder) (True/False)

.GetAbsolutePathName(strPath) - Returns a string with the full drive, path, and file names: Drive:\Path\To\File.Ext

.GetBaseName(strPath) - Returns a string with the file name, without the extension: File

.GetDrive(strDrive) - Returns an object referring to a drive

.GetDriveName(strDrive) - Returns a string referring to a drive. Drive:

.GetExtensionName(strPath) - Returns a string referring to the extension of the file. Ext

.GetFile(strPath) - Returns an object referring to a file.

.GetFileName(strPath) - Returns a string referring to a file. File.Ext

.GetFolder(strPath) - Returns an object referring to the path.

.GetParentFolderName(strPath) - Returns a string referring to the path. \Path\To\

.GetSpecialFolderName(FolderType) FolderType=SystemFolder/TemporaryFolder/WindowsFolder

.GetStandardStream(Type [,Unicode (True/False)])

.GetTempName()

.MoveFile(Source, Dest)

.MoveFolder(Source, Dest)

.OpenTextFile(strFile [,IOMode (0=append, 1=Read, 2=Write) [,Create (True/False) [,Format (0=Ascii,-1=Unicode,-2=default)]]])

Drive Properties:

AvailableSpace, DriveLetter, DriveType, FileSystem, FreeSpace,IsReady,

Path, RootFolder, SerialNumber, ShareName, TotalSize, VolumeName

File Properties:

Attributes, DateCreated, DateLastAccessed, DateLastModified,Drive,

Name, ParentFolder, Path, ShortName, ShortPath, Size, Type

File Methods: .copy, .Delete, .Move, .OpenAsTextStream

Folder Properties:

Attributes, DateCreated, DateLastAccessed, DateLastModified,Drive,

Files, IsRootFolder, Name, ParentFolder, Path,

ShortName, ShortPath, Size, SubFolders, Type

Folder Methods: .copy, .CreateTextFile, .Delete, .Move

Examples

Create a text file:

Dim objFS, objFile
Set objFS = CreateObject("Scripting.FileSystemObject")
Set objFile = objFS.CreateTextFile("C:\work\demo.txt")
objFile.WriteLine("some sample text")

Open an existing file:

Dim objFS, objFile

Set objFS = CreateObject("Scripting.FileSystemObject")

Set objFile = objFS.GetFile("C:\Work\Sample.xls")

WScript.Echo objFile.DateCreated & objFile.Name

Check drive space:

Dim objFS, objDrive, objDriveCount

Set objFS = CreateObject("Scripting.FileSystemObject")

Set objDriveCount = objFS.Drives

Set objDrive = objFS.Drives("C")

WScript.Echo objDriveCount & " Free Space " & objDrive.AvailableSpace

On Error Resume Next

OnErrorResumeNext1

On Error Statement

Enables or disables error-handling.

On Error Resume Next

On Error GoTo 0

Remarks

If you don't use an On Error Resume Next statement anywhere in your code, any run-time error that occurs can cause an error message to be displayed and code execution stopped. However, the host running the code determines the exact behavior. The host can sometimes opt to handle such errors differently. In some cases, the script debugger may be invoked at the point of the error. In still other cases, there may be no apparent indication that any error occurred because the host does not to notify the user. Again, this is purely a function of how the host handles any errors that occur.

Within any particular procedure, an error is not necessarily fatal as long as error-handling is enabled somewhere along the call stack. If local error-handling is not enabled in a procedure and an error occurs, control is passed back through the call stack until a procedure with error-handling enabled is found and the error is handled at that point. If no procedure in the call stack is found to have error-handling enabled, an error message is displayed at that point and execution stops or the host handles the error as appropriate.

On Error Resume Next causes execution to continue with the statement immediately following the statement that caused the run-time error, or with the statement immediately following the most recent call out of the procedure containing the On Error Resume Next statement. This allows execution to continue despite a run-time error. You can then build the error-handling routine inline within the procedure.

An On Error Resume Next statement becomes inactive when another procedure is called, so you should execute an On Error Resume Next statement in each called routine if you want inline error handling within that routine. When a procedure is exited, the error-handling capability reverts to whatever error-handling was in place before entering the exited procedure.

Use On Error GoTo 0 to disable error handling if you have previously enabled it using On Error Resume Next.

The following example illustrates use of the On Error Resume Next statement.

On Error Resume Next

Err.Raise 6 ' Raise an overflow error.

MsgBox "Error # " & CStr(Err.Number) & " " & Err.Description

Err.Clear ' Clear the error.

On Error - Examples

Syntax

On Error resume next - Enable error handling

On Error goto 0 - Disable error handling

Error properties:

err.Number (default)

err.Source

err.Description

Examples

In the examples below - replace the 'code goes here' line with your VBScript commands.

Example 1) Trap an error

On Error Resume Next
' code goes here
If Err.Number <> 0 Then
'error handling:

WScript.Echo Err.Number & " Srce: " & Err.Source & " Desc: " & Err.Description
Err.Clear
End If

Example 2) Trap an error or success

On Error Resume Next
' code goes here
If Err.Number = 0 Then

WScript.Echo "It worked!"

Else
WScript.Echo "Error:"

WScript.Echo Err.Number & " Srce: " & Err.Source & " Desc: " & Err.Description
Err.Clear
End If

Example 3) Trap an error

On Error Resume Next
' code goes here
If Err.Number <> 0 Then ShowError("It failed")

Sub ShowError(strMessage)

WScript.Echo strMessage

WScript.Echo Err.Number & " Srce: " & Err.Source & " Desc: " & Err.Description
Err.Clear

End Sub

HP Unified Functional Testing software

UFTHP

HP Unified Functional Testing software

Simplify test creation and maintenance with intuitive design approaches

Key Features

  • Simplified test creation and maintenance with keyword and drag-and-drop design approaches
  • Validate and report on multi-layer application test scenarios
  • Functional and regression testing for every major software application and environment
  • Enhanced integration with HP Quality Center for centralized, complete test management

New Features

  • HP Unified Functional Testing 11.5 automates functional testing earlier in the lifecycle and simplifies testing through a new Integrated Developer Environment (IDE)
  • HP Unified Functional Testing Mobile automates application functional testing on real mobile devices via public and private cloud testing environments
  • HP UFT Insight, with innovative image-based object recognition, allows the  testing software to recognize and record any application, irrespective of the tool used to build it.

Overview

HP Unified Functional Testing software is an industry-leading software that accelerates automated software testing by simplifying test design and maintenance for both GUI applications and non-GUI components, and also validates integrated test scenarios, resulting in reduced risk and improved quality for your modern applications. HP Unified Functional Testing includes the HP Functional Testing (HP QuickTest Professional and all the add-ins) and the HP Service Test products.

Key benefits

  • Automate testing of multi-layer test scenarios, including GUI and API testing
  • Powerful visual user experience and toolset
  • Testing of emerging technologies with innovative HP UFT Insight object recognition
  • Easy conversion of manual tests to automated tests
  • Framework definition for better test management thanks to tight integration to HP Business Process Testing and HP Application Lifecycle Management

GAReddy @ OneTestingCenter @ All Articles