Skip to main content

Posts

Showing posts from November, 2008

Files and Folders related Functions..

Files and Folders related Functions VBScript Runtime Properties Like the objects in the WSH core object model, VBScript runtime objects provide an extensive supply of properties. You can use the properties to view or change numerous file system attributes. These properties are listed here. · AtEndOfLine . Returns a value of either true or false depending on whether the file pointer precedes the TextStream file’s end-of-line marker. · AtEndOfStream . Returns a value of either true or false depending on whether the end of a TextStream file has been reached. · Attributes . Retrieves or sets file and folder attributes. · AvailableSpace . Retrieves the amount of free space available on a drive. · Column . Retrieves the current column position within a TextStream file. · CompareMode . Retrieves or sets the comparison mode used to compare a Dictionary object’s string keys. · Count . Returns a count of the items in a col

FileSystemObject..

Managing Files and Folders As you have already seen this afternoon the FileSystemObject is actually fairly easy to work with. All that you have to do is establish an instance of it and you can start using its properties and methods. In the sections that follow you’ll see examples of how to use this object to create, copy, move, and delete files and folders. Copying Files Using the FileSystemObject object’s CopyFile() method you can copy one or more files. For example, you might want to copy all the files in the folder on your computer to a network drive at the end of each day. I’ll show you how to work with network drives this evening. For now let’s just focus on how the CopyFile() method works.The first step in copying a file is to set up an instance of the FileSystemObject. Then you can execute its CopyFile() method as shown here. Set fsoObject = CreateObject("Scripting.FileSystemObject") fsoObject.CopyFile("d:\ displayText.txt", "d:\myDocs\ displayText.t

QTP Scripts examples...

1. Script for sending a mail using outlook express. Dim objOutlookMsg,objOutlook Set objOutlook = CreateObject(”Outlook.Application”) Set objOutlookMsg = objOutlook.CreateItem(olMailItem) objOutlookMsg.To = “” objOutlookMsg.CC = “ “ objOutlookMsg.BCC = “” objOutlookMsg.Subject = “test” objOutlookMsg.Body = “” objOutlookMsg.Attachments.Add “C:\Documents and Settings\Desktop\testreport.txt” objOutlookMsg.Send 2. Script for opening a Notepad file. In Expert view write a builtin funtion invokeapplication”c:/whatever the path” Run Dim a Set a = WScript.CreateObject (”WSCript.shell”) a.run “notepad.exe” Dim oShell Set oShell = CreateObject (”WSCript.shell”) oShell.run “cmd/notepad.exe” Set oShell = Nothing DsystemUtil.Run “Notepad.exe” 3. Script for connecting the oracle database public void connectDB() { Const adOpenStatic = 3 Const adLockOptimistic = 3 Const adUseClient = 3 Set objCon=CreateObject(”ADODB.Connection”) Set objRec=CreateObject(” ADODB.Recordset”) objCon.Open “DRIVER={Oracle i

QuickTest Professional (QTP) 8.2 Tips and Tricks

QuickTest Professional (QTP) What is QTP ? QuickTest is a graphical interface record-playback automation tool. It is able to work with any web, java or windows client application. Quick Test enables you to test standard web objects and ActiveX controls. In addition to these environments, QuickTest Professional also enables you to test Java applets and applications and multimedia objects on Applications as well as standard Windows applications, Visual Basic 6 applications and .NET framework applications… QTP is Mercury Interactive Functional Testing Tool. QTP stands for Quality Test Professional. Mercury QuickTest Professional: provides the industry’s best solution for functional test and regression test automation - addressing every major software application and environment. This next-generation automated testing solution deploys the concept of Keyword-driven testing to radically simplify test creation and maintenance. Unique to QuickTest Professional’s Keyword-driven approach