Dim qtApp, qtRepositories, lngPosition
'Open QuickTest and create the Application object
Set qtApp = CreateObject("QuickTest.Application")
qtApp.Launch
qtApp.Visible = True
'Open a test and get the "Login" action's object repositories collection
qtApp.Open "D:\Fatima\trial-qtp\adv topics\Test1", False, False
Set qtRepositories = qtApp.Test.Actions("Login").ObjectRepositories
' Add shared_rep.tsr if it's not already in the collection
If qtRepositories.Find("D:\Fatima\trial-qtp\adv topics\shared_rep.tsr") = -1 Then ' If the repository cannot be found
qtRepositories.Add "D:\Fatima\trial-qtp\adv topics\shared_rep.tsr", 1
End If
' If additional_rep.tsr is moved down the list - place it back at position 1
If qtRepositories.Count > 1 And qtRepositories.Item(1) = "D:\Fatima\trial-qtp\adv topics\additional_rep.tsr" Then
qtRepositories.MoveToPos 1,2
End If
' If debug.tsr is in the collection - remove it
lngPosition = qtRepositories.Find("D:\Fatima\trial-qtp\adv topics\debug.tsr")
If lngPosition <> -1 Then
qtRepositories.Remove lngPosition
End If
' Set the new object repository configuration as the default for all new actions
qtRepositories.SetAsDefault
qtApp.Test.Save
qtApp.Quit
Set qtRepositories = Nothing
Set qtApp = Nothing
I'm gonna post some useful Testing stuffs here,to share the knowledge, enjoy learning.............
Wednesday, December 31, 2008
Thursday, December 18, 2008
how to return a value from a function
Function func1(a,b)
sum = a+b
func1 = sum
End Function
aaa= func1(2,3)
msgbox aaa
Regards,
Pavankumar Nandagiri............
sum = a+b
func1 = sum
End Function
aaa= func1(2,3)
msgbox aaa
Regards,
Pavankumar Nandagiri............
Tuesday, November 11, 2008
how to call Library Files(.vbs) in the Test Script
method 1 :
ExecuteFile <>
method 2:
u can add library file to ur script through Test-----------
-->Resources tab here u find option called add file there u
can add ur files manually before running the script then
save it so when ever u open that script attached lib files
also opened with that script.
ExecuteFile <>
method 2:
u can add library file to ur script through Test-----------
-->Resources tab here u find option called add file there u
can add ur files manually before running the script then
save it so when ever u open that script attached lib files
also opened with that script.
Method 3:
path1="C:/Lib1"
path2="C:/Lib2"
set qtApp1 = CreateObject("QuickTest.Application")
Set qtLibraries = qtApp1.Test.Settings.Resources.Libraries ' Get the libraries collection object
qtLibraries.Add path1 ,1
qtLibraries.Add path2 ,2
Regards,
Pavankumar nandagiri..........
Thursday, November 6, 2008
FileSystemObject Properties
- AtEndOfLine Property
- Returns true if the file pointer is positioned immediately before the end-of-line marker in a TextStream file; false if it is not.
- AtEndOfStream Property
- Returns true if the file pointer is at the end of a TextStream file; false if it is not.
- Attributes Property
- Sets or returns the attributes of files or folders.
- AvailableSpace Property
- Returns the amount of space available to a user on the specified drive or network share.
- Column Property
- Returns the column number of the current character position in a TextStream file.
- CompareMode Property
- Sets and returns the comparison mode for comparing string keys in a Dictionary object.
- Count Property
- Returns the number of items in a collection or Dictionary object.
- DateCreated Property
- Returns the date and time that the specified file or folder was created. Read-only.
- DateLastAccessed Property
- Returns the date and time that the specified file or folder was last accessed.
- DateLastModified Property
- Returns the date and time that the specified file or folder was last modified.
- Drive Property
- Returns the drive letter of the drive on which the specified file or folder resides.
- DriveLetter Property
- Returns the drive letter of a physical local drive or a network share.
- Drives Property
- Returns a Drives collection consisting of all Drive objects available on the local machine.
- DriveType Property
- Returns a value indicating the type of a specified drive.
- Files Property
- Returns a Files collection consisting of all File objects contained in the specified folder, including those with hidden and system file attributes set.
- FileSystemProperty
- Returns the type of file system in use for the specified drive.
- FreeSpace Property
- Returns the amount of free space available to a user on the specified drive or network share.
- IsReady Property
- Returns true if the specified drive is ready; false if it is not.
- IsRootFolder Property
- Returns true if the specified folder is the root folder; false if it is not.
- Item Property
- Sets or returns an item for a specified key in a Dictionary object. For collections, returns an item based on the specified key.
- Key Property
- Sets a key in a Dictionary object.
- Line Property
- Returns the current line number in a TextStream file.
- Name Property
- Sets or returns the name of a specified file or folder.
- ParentFolder Property
- Returns the folder object for the parent of the specified file or folder.
- Path Property
- Returns the path for a specified file, folder, or drive.
- RootFolder Property
- Returns a Folder object representing the root folder of a specified drive.
- SerialNumber Property
- Returns the decimal serial number used to uniquely identify a disk volume.
- ShareName Property
- Returns the network share name for a specified drive.
- ShortName Property
- Returns the short name used by programs that require the earlier 8.3 naming convention.
- ShortPath Property
- Returns the short path used by programs that require the earlier 8.3 file naming convention.
- Size Property
- For files, returns the size, in bytes, of the specified file. For folders, returns the size, in bytes, of all files and subfolders contained in the folder.
- SubFolders Property
- Returns a Folders collection consisting of all folders contained in a specified folder, including those with hidden and system file attributes set.
- TotalSize Property
- Returns the total space, in bytes, of a drive or network share.
- Type Property
- Returns information about the type of a file or folder.
- VolumeName Property
- Sets or returns the volume name of the specified drive.
PavanKumar Nandagiri..............
Wednesday, October 1, 2008
QTP Testing process
- Create your test plan - Prior to automating there should be a detailed description of the test including the exact steps to follow, data to be input, and all items to be verified by the test. The verification information should include both data validations and existence or state verifications of objects in the application.
- Recording a session on your application - As you navigate through your application, Quick Test graphically displays each step you perform in the form of a collapsible icon-based test tree. A step is any user action that causes or makes a change in your site, such as clicking a link or image, or entering data in a form.
- Enhancing your test - Inserting checkpoints into your test lets you search for a specific value of a page, object or text string, which helps you identify whether or not your application is functioning correctly. NOTE: Checkpoints can be added to a test as you record it or after the fact via the Active Screen. It is much easier and faster to add the checkpoints during the recording process. Broadening the scope of your test by replacing fixed values with parameters lets you check how your application performs the same operations with multiple sets of data. Adding logic and conditional statements to your test enables you to add sophisticated checks to your test.
- Debugging your test - If changes were made to the script, you need to debug it to check that it operates smoothly and without interruption.
- Running your test on a new version of your application - You run a test to check the behavior of your application. While running, Quick Test connects to your application and performs each step in your test.
- Analyzing the test results - You examine the test results to pinpoint defects in your application.
- Reporting defects - As you encounter failures in the application when analyzing test results, you will create defect reports in Defect Reporting Tool.
Subscribe to:
Posts (Atom)