WORKING WITH QTP

TestEveryThinG

Jmeter: pass a value between threads

Posted by rajivkumarnandvani on January 11, 2012

Find out ways to pass a value between threads (i.e. capturing a value in one of the thread and passing it to the other thread in the same test plan).
Tool Used:     JMeter: Performance testing tool.
Solution:       Sharing Variables


Read the rest in  Testeverythingqtp   Article….

Thanks.

Posted in QTP | Tagged: , , , , , | Leave a Comment »

Tips to Decide What Test Cases to Automate

Posted by rajivkumarnandvani on December 1, 2011

It is impossible to automate all testing; the first step to successful automation is to determine what test cases should be automated first.

The benefit of automated testing is correlated with how many times a given test can be repeated. Tests that are only performed a few times are better left for manual testing. Good test cases for automation are those that are run frequently and require large amounts of data to perform the same action.

You can get the most benefit out of your automated testing efforts by automating:…..

Read the rest in  Testeverythingqtp  Article….

Thanks.

Posted in QTP | Leave a Comment »

How to Use the VBScript RegExp Object

Posted by rajivkumarnandvani on September 18, 2011

Hi All,
                                                                                                                                                                                                                                                        I faced a situation where I had to update the field’s value from another file. I can not use the string replace method because It will replace the all the matches value, While I want to replace the first match with the first value of another file.  Here I am trying to explain
                                                                                                                                                                                                                                                              First File Contents:
                                                                                                                                                                                                                                                             This blog refers to QTP.
I want to get first line value “=”  from another file.
Here I am using Rexexp
with global property value false
Now I want to get Second line value “=”  from another file.
Global property false will serach only first match
If regexp global property true then it search all the matches
Now I want to get Third line value “=”  from another file.
                                                                                                                                                                                                                                                             Second File Contents:
                                                                                                                                                                                                                                                                    Rajiv
Kumar
Nandvani
                                                                                                                                                                                                                                                                              I want output like this:
                                                                                                                                                                                                                                                            This blog refers to QTP.
I want to get first line value “Rajiv“  from another file.
Here I am using Rexexp
with global property value false
Now I want to get Second line value “Kumar“  from another file.
Global property false will serach only first match
If regexp global property true then it search all the matches
Now I want to get Third line value “Nandvani“  from another file.
                                                                                                                                                                                                                                                           Here is the code that I have used to solve this problem
Read the Rest in TestEveryThinGQTP….

Posted in QTP | Leave a Comment »

QTP Mercury DeviceReplay vs SendKeys/ Right click mouse

Posted by rajivkumarnandvani on July 28, 2011

The Device Replay feature is used to perform mouse and keyboard actions against screen coordinates that are provided. The Device Replay functions are not automatically recorded, but must be programmed manually in the Expert View.

For more info click here

Posted in QTP | 1 Comment »

Select the row in WEBTABLE/WEBGRID using QTP/DOM

Posted by rajivkumarnandvani on July 23, 2011

Hi All,

I found that most of time while working with WEBTABLE we need to the select the row based on some criteria by clicking checkbox or radiobutton.For that first we have to find the row which we have to select based on value of that row like text/link inside the row.
Here I am giving an example how to select a row in Webtable by finding the text. Logic I am using here is first i will find the row number from webtable where my searching text is present using GetRowWithCellText method then I will provide the column name/index of webtable where checkbox is present.


In below mentioned example I will select the row where Confirmation Number is “15204
Let’s see

Select Date ConfirmationNumber User Name Organization Name
17-SEP-2008
13761
 SMITH’S LP SUPPLY CO.
24-OCT-2008
13808
 Micro Motion test1
30-OCT-2008
13874
 EMERSON PROCESS MANAGEMENT ASIA PACIFIC PTE LTD
13-JUN-2009
15058
 Spartan Controls Ltd.
08-AUG-2009
15204
 Emerson Process Management

 Click here to get full details…

Posted in QTP, WEB | Tagged: , , | 5 Comments »

Highlight the text on page using the QTP

Posted by rajivkumarnandvani on May 25, 2011

Hi All,

Someone asked me how to highlight the text on page using the QTP. So here I have created a function that will find the text on page and highlight it if finds else not.

REM  ——  Set page object     ———
set objpage = Browser(“BrowserName”).Page(“Pagename”)
call   HighLightTextPresentOnPage(objpage ,”News” )
Function HighLightTextPresentOnPage(byval objpage , byval Textvalue )
On error resume next
REM ——- Create child object description
Set childobj = Description.Create()
childobj(“micclass”).value=”WebElement”
childobj(“html tag”).value=”.*[A-Za-z0-9].*”
childobj(“outertext”).value =Textvalue
REM  ———-Create ALL child object 
set allobj = objpage.ChildObjects(childobj)
 REM here highlight method we will use that is in build in QTP for object
For i=1 to allobj.count-1
    allobj.Item(i).HighLight
Next
           If allobj.count > 0 then
              HighLightTextPresentOnPage = true
           Else
              HighLightTextPresentOnPage = false
           End if
             On Error GoTo 0
End Function

Posted in QTP, WEB | Leave a Comment »

Started New Blog on blogspot

Posted by rajivkumarnandvani on May 11, 2011

Hi ALL,

I have started my new blog about QTP  on google blog spot.

here is the link

http://testeverythingqtp.blogspot.com/

Posted in FAQ QTP | Leave a Comment »

QTP 11 Installation Issues/Errors

Posted by rajivkumarnandvani on April 15, 2011

Hi All ,

Most of time, we are facing the problem while running the QTP OR installation but some times these problems are unknown to us because we did not read the installation procedure or limitations or known issues, So please have a look :-

Notes and Limitations

This section includes the following:

  • Before You Install
  • Supplemental Information

Before You Install

This section includes information that is important for you to know before you install QuickTest.

  • You cannot install QuickTest when a McAfee Anti-Virus application is running.

Workaround: Disable the antivirus application during the QuickTest installation process.

  • QuickTest Professional supports the Sentinel RMS License Manager version 8.3.0 as its concurrent license server. Earlier versions of the concurrent license server are not supported.

  • QuickTest does not support Windows user names with non-English letters. If you log in to Windows using a user name (with administrative privileges) that contains non-English characters and then install QuickTest, the installation may complete successfully, but you may not be able to open QuickTest or it may not behave correctly.

  • The path in which installation files for QuickTest are located, and the path in which QuickTest is installed, can contain only English characters.

  • When upgrading to QuickTest 11.00 from a QuickTest 9.5 or 10.00 installation on which a Language Pack (localized version of QuickTest) was previously installed, you may get an error message when opening QuickTest after the upgrade.

Workaround: Repair the installation:

  • In the Control Panel, select Add/Remove Programs and select the HP QuickTest Professional entry.

  • Click the Change button.

  • In the installation wizard that opens, choose the Repair option and follow the on-screen instructions.

  • If you install QuickTest 11.00 while the QTPNET_00015 patch (a QuickTest 10.00 patch) is installed on your computer, QuickTest may behave unexpectedly.

Workaround:

  • Open the Add/Remove Programs dialog box from the Control Panel.

  • Display the installed patches by selecting the Show updates check box (or click the View Installed Updates button, depending on your operating system version.)

  • Locate HP QuickTest Professional in the list and check whether QTPNET_00015 for HP QuickTest Professional 10.00 QFE is listed as an installed update.

  • If it is installed, click Remove to uninstall this patch before you install QuickTest 11.00.

  • If you want to work with .NET 4.0, it is best to install it before you install QuickTest. If you install .NET 4.0 after you install QuickTest, you must manually register two .NET DLLs as follows:

In <QuickTest installation folder>\GlobalAssemblyCache\Net4, execute the following commands:

  • ..\..\bin\GACRegUtil4x86.exe -i Mercury.QTP.Agent.dll

  • ..\..\bin\GACRegUtil4x86.exe -i Mercury.QTP.WpfAgent.dll

  • In Windows XP and Windows 2003, if you install the Oracle Add-in, the Windows Remote Shell Service (rshsvc.exe) may fail and display an error message every time you restart the computer. This occurs only if the Remote Shell Service is configured to run automatically.

Supplemental Information

Use the information in this section as a supplement to the product documentation.

Additional troubleshooting information, guidelines, and feature-specific limitations are described in the relevant locations of the installation and product documentation. Make sure you are aware of those issues when working with the relevant features.

This section includes the following:

Installation

  • When you install a new QuickTest 11.00 installation and you specify a single concurrent license server in the License Wizard, QuickTest now automatically specifies the server in an LSFORCEHOST environment variable, to optimize performance. However if you perform an upgrade from QuickTest 10.00, and you already had an LSHOST variable defined, the upgrade installation does not change the setting to LSFORCEHOST.

Workaround: If desired, set the LSFORCEHOST variable manually, as described in the HP Functional Testing Concurrent License Server Installation Guide.

  • If you manually set an LSHOST environment variable to a particular server (or upgrade from a previous version of QuickTest where the LSHOST variable was set), QuickTest sometimes gets its license from another server, even when the specified server has the required licenses available.

Workaround: To ensure that a specific server will be used, specify an LSFORCEHOST environment variable instead.

Operating Systems

If you work with QuickTest on a Windows 7 operating system with User Account Control (UAC) turned on, and you open a test from a protected location (such as Program Files), it is opened in read-only mode and a message is displayed that you do not have permissions to open it in read-write mode.

General

  • When you save a test using the Save Test with Resources option, it also saves any tests containing called external actions. However, to preserve space, these called tests contain only the called actions, and not all of the actions from the original test. Therefore, you cannot open these called tests in QuickTest from the local copy.

Workaround: If you need to have full access to the called tests as well as the main test that you save using the Save Test with Resources option, then you must manually save all required tests locally and then manually edit all references to the relevant actions from the main test to the actions it calls.

Web Add-in

  • The If Handler option in the Web Event Recording Configuration dialog box works on Mozilla Firefox browsers only if the handler is assigned as an attribute (for example, <A onclick = “some code”/>) and not if it is assigned as a property (for example, aObj.onclick = function() {some code})

Silverlight Add-in

  • When Silverlight applications are opened in two tabs sequentially (without QuickTest performing any operations on the first one before the second opens), QTP will use a custom server to support controls only in the first application with which you interact. The same is true when two tabs are refreshed sequentially.

Workaround: Perform an operation (for example, use the Object Spy) with the first tab opened/refreshed before opening/refreshing the second one.

  • If a Web page contains a Silverlight application that is windowless and is scrolled out of view when the page opens the first time, QuickTest will not be able to make this application visible. (For example, in this scenario, QuickTest will not be able to perform an SlvWindow.MakeVisible step).

Quality Center and Business Process Testing

  • When comparing two baselines, if the only change in a resource is its association to a test or component, the Asset Comparison Tool does not indicate any change in the resource even though HP ALM or Quality Center may indicate that the resource is Modified.

  • If an HP ALM or Quality Center user manually changes the status of a test instance run, HP ALM/Quality Center creates something called fast run results to record the change of the test status. The fast run results are not valid QuickTest run results files. However, when you try to select results to open or delete in the Run Results Viewer or Run Results Deletion tool, the fast run results are available in the list.

  • After you run a component locally in QuickTest, you cannot use the Jump to Step in QuickTest option from the Run Results Viewer.

  • You cannot perform a remote execution of a business process test on a Windows 2008 R2 QuickTest computer.

Documentation

  • The QuickTest Help Index tab contains only reference items, such as objects, methods, properties, and functions. It does not contain any entries from the user guides.

To search for information from all the documents in the QuickTest Documentation Library, use the Search tab.

  • On some operating systems or after installing certain Windows service packs or updates, you may not be able to view the content of some Help files.

Workaround:

  • Right-click the CHM file in <QTP installation folder)\help, and click Properties.

  • In the dialog box that opens, click Unblock.

For details, see http://support.microsoft.com/kb/902225

Internationalization

  • If you are working with a QuickTest User Interface Pack, install it before running QuickTest for the first time, if possible.

If you install a QuickTest User Interface Pack after running QuickTest, the following items may remain in English after installing the User Interface Pack:

  • Menus and toolbars in the Object Repository window (in QuickTest or in the Object Repository Manager)

  • The Find dialog box in the Expert View

Workaround: Close QuickTest and delete the folder: %APPDATA%\HP\QuickTest Professional
(For example, C:\Documents and Settings\<username>\Application Data\HP\QuickTest Professional).

  • When working on an operating system using a Spanish locale, you may get an assertion error message at the beginning of the QuickTest installation.

Workaround: Modify the sLanguage registry key value as follows:

  • In the Start > Run dialog box, type: regedit.

  • Go to the registry path: HKEY_CURRENT_USER\Control Panel\International

  • Change the sLanguage value from ES to ESN

  • If the above steps do not solve the problem, restart your computer and try again.

Run the QuickTest installation again.

  • Selecting the View Sample Snapshot option in the QuickTest Asset Comparison Tool opens a window containing a sample image of the selected element in QuickTest. The image displays the English user interface.

  • The Add-in Extensibility SDKs are not localized.

Posted in FAQ QTP, QTP | 4 Comments »

QTP 11 New Object Spy Functionality

Posted by rajivkumarnandvani on April 11, 2011

Hi All,

In QTP 11 Object Spy has been improved now with following features:

  • Add an object to a repository
  • Highlight an object in your application
  • Copy/paste object properties
    • Add an object to a repository. You can now add an object to the object repository directly from the Object Spy.
    • Highlight an object in your application. When you select a test object in the Object Spy Object hierarchy tree, you can then select to highlight the object in your application that corresponds to that test object.
    • Copy/paste object properties. You can copy the identification properties and values of a selected test object in the Object Spy and paste the details into any document. The details are formatted in programmatic description syntax. This option is especially useful if you want to compare the properties and values of two objects in your application or when creating programmatic descriptions.

Additionally, the Object Spy has a new, cleaner look and feel:

QTP 11 New Object Spy

QTP 11 New Object Spy

Posted in QTP | Tagged: , | Leave a Comment »

How to export data from database table to Excel sheet and Datatable

Posted by rajivkumarnandvani on March 25, 2011

Hi All
‘ REM  Adding NewDataSheet in Run Time
DataTable.AddSheet “MySheet”

‘ REM  Adding Column name in Run time
DataTable.GetSheet(“MySheet”).AddParameter “bname”,” “

REM Create DataBase Connection
Set objCon = CreateObject(“ADODB.Connection”)
objCon.Open”Provider=SqlOledb.1;Server=sys;uid=sa;pwd=;database=db1″
REM (OR)  Open DataBase Connection

objCon.Open”Provider=Microsoft.Jet.Oledb.4.0;Data Source=D:\NewDB.mdb”

REM  Creating Record set for DataSet
Set objRs=CreateObject(“adodb.recordset”)

REM Opening RecodSet form DataBase( storing the values in recordsetb )
objRs.open”select * from Emp”,objCon

REM Loop for Getting DataBase Column name
For intCount = 1 to objRs.Fields.Count-1
i = 1

REM column name in run time data sheet using add parameter method
DataTable.GetSheet(“MySheet”).AddParameter objRs.Fields(intCount).Name,” “

REM Loop for Checking end of the Recod
While objRs.eof<>true
REM  Seting the current row
DataTable.SetCurrentRow(i)
REM   increments for data table row
i=i+1
REM  Assigning the DataBase Values into DataTable
DataTable.Value(objRs.Fields(intCount).Name,”MySheet”) = objRs.Fields(intCount).Value
REM’ ——->  moving the record  pointed to next record
objRs.MoveNext
Wend
REM  moving the record  pointed to First record
objRs.MoveFirst
Next 

REM Exporting the results in local
DataTable.ExportSheet”D:\MyTest.xls”,3

Posted in QTP | Leave a Comment »

 
Follow

Get every new post delivered to your Inbox.

Join 85 other followers