Test automation

Test automation
AUtomation

Wednesday, April 30, 2008

QTP with windows vista

QuickTest Professional 9.2:
QuickTest Professional 9.2 supports Windows Vista 32-bit Edition.Working with Windows Vista:* The security settings in Microsoft Windows Vista may prevent you from performing a QuickTest Professional-related installation, such as a patch installation, or connecting to a Quality Center project (either directly or from QuickTest Professional). This can occur when the User Account Control (UAC) option in Windows Vista is set to ON, and you have not yet connected to a Quality Center project (if relevant).Workaround: To work with Quality Center, temporarily turn off the User Account Control (UAC) option, as follows:1. Log in to Windows Vista as an administrator.2. From the Control Panel, choose User Accounts > Change Security Settings.3. Clear the Use User Account Control (UAC) to help protect your computer check box and click OK.4. Connect to Quality Center as usual. After connecting to Quality Center, you can turn the User Account Control (UAC) option on again. Hereafter, you should be able to connect to Quality Center, as needed.* Due to a problem opening DCOM permissions on Windows Vista, QuickTest does not run properly on a remote Windows Vista host from Quality Center.Workaround: Run RmtAgentFix.exe from the \bin folder.* On Windows Vista, QuickTest Professional seat licenses may not work correctly if you are not logged on as an administrator. (Note that concurrent licenses work as usual.)Workaround: On Windows Vista, install QuickTest Professional and any QuickTest add-ins as an administrator. To do this, right-click setup.exe from the root folder of the QuickTest Professional installation CD and choose Run as administrator.Then, every time you open QuickTest, open it as an administrator. To do this, right-click the QuickTest Professional icon on your desktop and choose Run as administrator.* On Windows Vista 32-bit, QuickTest Professional text recognition features (such as text checkpoints and output values, GetVisibleText and GetTextLocation test object methods, and TextUtil.GetText and TextUtil.GetTextLocation reserved object methods) are limited and are not always reliable.Workaround: On Windows Vista, you can improve text recognition by applying the Classic Windows theme and by setting the mode key in the Windows Registry Editor to 3 - OCR only (described above).* When using the Mercury Screen Recorder on Windows Vista, setting the Window's display settings to the Classic Windows theme may improve performance.* Record and run session performance may be affected adversely when using the Mercury Screen Recorder on a computer running Windows Vista 32-bit or any 64-bit operating system. This is because some capture drivers (such as Blueberry or ASUS' Enhanced Display Driver) cannot be installed on these operating systems. Note that if you try to install the capture driver from the Screen Recorder Options dialog box while working on one of these operating systems, an error message is displayed.
QuickTest Professional 9.1:
QuickTest Professional 9.1 supports 'Windows Vista Beta 2-build 5384'.Working with Windows Vista:* When installing QuickTest Professional on Windows Vista Beta 2, the QuickTest icon is not installed on your desktop or in the Start menu. (A default icon is installed instead.)Work-around: Modify the icon manually.* QuickTest Professional does not support the recording of operations on the Start menu of Windows Vista Beta 2.* The security settings in Windows Vista Beta 2 may prevent you from connecting to a Quality Center project (either directly or from QuickTest Professional). This can occur when the User Account Control (UAC) option in Windows Vista is set to ON, and you have not yet connected to a Quality Center project.Work-around: To work with Quality Center, temporarily turn off the User Account Control (UAC) option, as follows:1. Log in to Windows Vista as an administrator.2. From the Control Panel, choose User Accounts -> Change Security Settings.3. Clear the Use User Account Control (UAC) to help protect your computer check box and click OK.4. Connect to Quality Center as usual. After connecting to Quality Center, you can turn the User Account Control (UAC) option on again. Hereafter, you should be able to connect to Quality Center, as needed.* When working with Internet Explorer 7.0 Beta 3, QuickTest Professional may not recognize Web objects, even though the Web Add-in is installed and loaded.Work-around: In Internet Explorer 7.0 Beta 3, choose Tools -> Internet Options. In the Security tab, clear the Enable Protected Mode check box and click OK.* Due to a problem opening DCOM permissions on Windows Vista Beta 2, QuickTest does not run properly on a remote Windows Vista Beta 2 host from Quality Center.Work-around: Run RmtAgentFix.exe from the \bin folder.
QuickTest Professional 9.0 and below:
QuickTest Professional 9.0 (and below) does not support Windows Vista.



Monday, April 21, 2008

QTP and File Handling

Many a times you may need to interact with text files using QTP. Interaction can be(but not limited to) in the form of reading input from a file, writing output to a file. This post describe in detail "File handling using QTP".
We use FSO object to do this.
What is FSO?
FSO stands for File System Object. This is used to support text file creation and manipulation through the TextStream object and is contained in the Scripting type library (Scrrun.dll)
The FSO Object Model has a rich set of properties, methods and events to process folders and files.
How to create a file?
We first create a FSO object using CreateObject and then create a text file using CreateTextFile.
For Example: Suppose you want to create a file called "test.txt" located in C:
Dim fso, file, file_location
file_location = "C:\file_location"
Set fso = CreateObject(“Scripting.FileSystemObject”)
Set file = fso.CreateTextFile(file_location, True) // True--> file is to be overwritten if it already exists else false
We would use the same example for the rest of this post.
How to open a file?
Set file= fso.OpenTextFile("C:\file_location", ForWriting, True)
//2nd argument can be ForReading, ForWriting, ForAppending
//3rd argument is "True" if new file has to be created if the specified file doesn’t exist else false, blank signify false.
How to read content from a file?
Use ReadLine() method
For example:
Set file= fso.OpenTextFile("C:\file_location", ForReading, True) //2nd argument should always be "ForReading" in order to read contents from a file
Do while file.AtEndofStream <> True
data = file.ReadLine()
msgbox data
Loop
How to write content to a file?
You can use Write() or WriteLine() Methods to write text into a file. The difference between the Write() and WriteLine() Method is that the latter automatically inserts a new line character while the former doesn’t insert a new line character.
For example:
Set file= fso.OpenTextFile("C:\file_location", ForWriting, True) //2nd argument should always be "ForWriting" in order to write contents to a file
file.Write("This is a place to get all your qtp")
file.Write("questions and answers solved.")
//Output will be:
This is a place to get all your qtp questions and answers solved.
while
file.WriteLine("This is a place to get all your qtp")
file.Write("questions and answers solved.")
//Output will be:
This is a place to get all your qtp
questions and answers solved.
How to delete content?
Use DeleteFile() method to delete a file from a particular location
Foe Example:
file_location = "C:\file_location"
Set fso = CreateObject(“Scripting.FileSystemObject”)
fso.DeleteFile(file_location)