QTP Codes blog is being updated. You will see post design changes shortly.
Thursday, September 29, 2011
More Methods For PathFinder Object
Most of us are aware of the Locate method available for PathFinder object. But there are more useful and unfamiliar methods associated with PathFinder Object. I would like to share how these methods can be used in QTP.
# INSERT
Description:
This method is used to add a new folder path to the Folders list (Tools-> Options-> Folders).
Syntax:
# FIND
Description:
This method returns the Index of the specified path.
Syntax:
# MOVEITEM
Description:
This method can be used to swap the Index of two folder paths.
Syntax:
# REMOVE
Description:
This method removes the specified folder path from the folders list.
Syntax:
# REMOVEALL
Description:
This method removes all the items from the folders list.
Syntax/Example:
# REMOVEBYINDEX
Description:
This method removes the folder path item using Index.
Syntax:
# SAVE
Description:
This method can be used to commit all the changes which are done using PathFinder object. If Save method is not used, your changes in Folder List will not be retained.
Syntax/Example:
# INSERT
Description:
This method is used to add a new folder path to the Folders list (Tools-> Options-> Folders).
Syntax:
PathFinder.Insert [Path],[Index]Example:
PathFinder.Insert "C:\Test",0The above example will add new folder path to the Folders list.
# FIND
Description:
This method returns the Index of the specified path.
Syntax:
Msgbox PathFinder.Find [Path]Example:
Msgbox PathFinder.Find("C:\Test")The above example returns the Index of the specified path. If the path is not found, it will return -1.
# MOVEITEM
Description:
This method can be used to swap the Index of two folder paths.
Syntax:
Pathfinder.MoveItem [Source_Index],[Destination_Index]Example:
Pathfinder.MoveItem 1,0
# REMOVE
Description:
This method removes the specified folder path from the folders list.
Syntax:
Pathfinder.Remove [Path]Example:
Pathfinder.Remove("C:\Test")
# REMOVEALL
Description:
This method removes all the items from the folders list.
Syntax/Example:
Pathfinder.RemoveAllNote: It removes default folder item as well.
# REMOVEBYINDEX
Description:
This method removes the folder path item using Index.
Syntax:
PathFinder.RemoveByIndex([Path_Index])Example:
PathFinder.RemoveByIndex(0)
# SAVE
Description:
This method can be used to commit all the changes which are done using PathFinder object. If Save method is not used, your changes in Folder List will not be retained.
Syntax/Example:
PathFinder.Save
Subscribe to:
Posts (Atom)