Automation Testing, Manual Testing, QTP/UFT 11 , QC/ALM 11 ,SAP TAO, Unix, Selenium, Oracle SQL, Shell Scripting and For Online Trinings to contact me : Cell:+91-8897972059 , Email Id : quicktestprotech@gmail.com

Tuesday, December 20, 2016

Error: "RPC server is unavailable" or "Access is denied" during remote execution

Error: "RPC server is unavailable" or "Access is denied" during remote execution
The user receives the following error message when executing a automated script remotely:
  • The RPC server is unavailable 
  • Access is denied
Note: Executing the script locally works correctly

Solution

Quality Center (QC) and ALM use DCOM, a Microsoft technology,  for remote execution between the QC client and the remote testing machine.
  • Error: "Access is denied"  - This generally indicates a DCOM permission problem
  • Error: "RPC Server is unavailable" - This generally indicates a connectivity issue (e.g. Unable to communicate on port 135)
The steps below provide details on how to make sure the Windows Firewall is not blocking port 135 and on how to configure DCOM permissions.
Notes:
  • IMPORTANT. The follow steps assume:
    • Hostname or value under "Run on Host" has being tested with ping command. If hostname or DNS name is used and shows problems, then check IP Address
    • HP Client Components have being registered.
       
  • The security changes suggested below should be applied by a System Administrator.
     
  • If the firewall installed with Windows has being disabled, it is not needed to apply the steps in Part II below. However, a utility (CPT33502C.zip) has been created to automate the steps for opening the ports outlined in Part II.
     
  • Part III - V can be applied automatically by running the attached batch file. For more information about BAT file, see section below called "Batch DCOM approach"
     
The following is the manual process for opening the firewall ports and modifying the DCOM properties for QTP / UFT, BPT, System Test, LoadRunner, and VAPI-XP.
  • Part I: Add the Windows user that is running the QC client to the Local Administrators group on the remote testing machine. This is required for Windows to authenticate the remote user executing the tests against the DCOM objects.

    IMPORTANT: The windows user must have the exact same user name and password (ideally the same domain user here )
     
  • Part II:  On the Testing Tool client machine configure Windows Firewall to allow Port 135 for DCOM:
    1. Select Start -> Control Panel -> Windows Firewall.
    2. Navigate to the Exceptions tab.
    3. Configure the Remote Agent to be allowed under "Programs and Services." Configuration should be done for each testing tools as given below:
      • QuickTest Professional Remote Agent (path: <System Drive>:\Program Files\HP\QuickTest Professional\bin\AQTRmtAgent.exe)
      • Execution Agent for Business Process Testing (QC path: <System Drive>:\Program Files\Common Files\Mercury Interactive\Quality Center\bp_exec_agent.exe or ALM path: <System Drive>:\Users\<WindowsUser>\AppData\Local\HP\ALM-Client\<ServerFolder>\be)
    4. Click on <Add Port> and add the DCOM TCP port 135 to the Exceptions list.

      Note: The remote agent is a DCOM object and requires port 135 to work. The list of "Port Assignments for Commonly-Used Services" is provided in the URL below:
      http://technet.microsoft.com/en-us/library/cc959833.aspx
       
  • Part III: Modify DCOM Security Properties:
    1. Select Start > Run > type "dcomcnfg".
    2. Navigate to Console Root -> Component Services -> Computers -> My Computer.
      Note:
      If Windows Security Alert dialog window appears, click on <Ask me later> or <Unblock>
       
    3. Right-click on "My Computers" and select "Properties."
    4. Navigate to the "Default Properties" tab.
    5. Make sure the "Default Impersonation Level" is "Identify."
    6. Click <Apply>.
    7. Navigate to the "Default COM Security" tab.
    8. Under "Access Permissions", click on <Edit Limits>. The "Access Permission" dialog window appears.
    9. Click on <Add>. The "Select Users or Groups" dialog windows appear.
    10. Click on <Advanced>.
    11. Click on <Find Now>.
    12. Add the following groups and users from the local machine:
      • Administrator
      • Administrators
      • Authenticated User
      • Anonymous Logon
      • Everyone
      • Interactive
      • Network
      • System
         
    13. Click <OK>.
    14. Add the following groups and users from the domain:
      • <tdomain user logged into the QTP/UFTbox>
      • <domain user logged into the TD client box executing the remote execution>
         
    15. Click <OK>.
    16. Give "Local Access" and "Remote Access" permissions to the groups and users.
    17. Click <OK>.
    18. Under Access Permissions, repeat steps 9-17 for <Edit Default>.
    19. Under Launch and Activation Permissions, click on <Edit Limits>. The Launch Permission dialog window appears.
    20. Repeat steps 9-15.
    21. Enable "Local Launch," "Remote Launch," "Local Activation," and "Remote Activation" permissions to the groups and users.
    22. Click <OK>.
    23. Repeat steps 20-22 for <Edit Default>.
       
  • Part IV: (for QTP / UFT only)
    1. While still in the Component Services window, navigate to Console Root -> Component Services -> Computers -> My Computer -> DCOM Config.
    2. Look for the following:
      • AQTRmtAgent (QTP, UFT 12.01 and earlier)
        {25E8BB22-5C86-11D4-90DA-00104B3E51B1}
         
      • QuickTest Professional Automation
        {A67EB23A-1B8F-487D-8E38-A6A3DD150F0B}
         
      • TlpRmtServer (QTP only, not UFT)
        {70396405-BE62-11D2-8F0B-00104B3E51B1}
         
      • UFTRemoteAgent (UFT 12.02 and later)
        {6F3D6AE0-F130-4830-993C-6FFCBB0FA7CF}
         
    3. For each of these DCOM applications, right click and select <Properties>.
    4. Under the Identity tab, select <The Interactive User>. This will allow the DCOM application to authenticate the process against the logged in Windows user and run the process in that security context.
    5. Next, go to the Security tab.
    6. For both the <Launch and Activation Permissions> and <Access Permissions>, select <Use Default>. This will use the Default security settings as we did in Part III.
    7. Click Apply, then OK to commit the changes.
    8. Now, you are ready to run a remote execution test with QTP.
       
  • Part V:
    1. While still in the Component Services window, navigate to Console Root -> Component Services -> Computers -> My Computer -> DCOM Config.
    2. Look for the following (and repeat steps for each if found)
      • Vapi-XP object
        {6A03829E-EC39-4802-A631-3841484EFBE3}
        {FCB69899-EC52-4A7A-86DB-3655E9FDBA58}
         
      • Business Process Testing object
        {6108A56C-6239-41F6-8C0F-94D9CE0D4B61}
         
      • Business Process Testing object (UFT only)
        {87EB2F8C-03B0-4B86-BBF2-78B7CB15A637}
         
      • LoadRunner Testing object
        {E933439A-81A1-11D4-8EEE-0050DA6171E8}
         
      • System Test Remote Agent
        {1B78CAE4-A6A8-11D5-9D7A-000102E1A2A2}
         
    3. For each of these DCOM applications (if found), right click and select <Properties>.
    4. Under the Identity tab, select <The Interactive User>. This will allow the DCOM application to authenticate the process against the logged in Windows user and run the process in that security context.
    5. Next, go to the Security tab.
    6. For both the <Launch and Activation Permissions> and <Access Permissions>, select <Use Default>. This will use the Default security settings as we did in Part III.
    7. Click Apply, then OK to commit the changes.
Notes:
  1. If you have not configured the Remote Agent to be allowed under "Programs and Services," a Windows Security Alert message will appear while running a test remotely. Click <Unblock> to resolve this problem. The next time you execute an automated script, the warning will not appear.
     
  2. If after performing all the described steps and you still receive "The RPC server is unavailable" message, create some shared folder anywhere on the Testing Tool machine.
     
  3. If still an issue, disable any anti-virus running on remote machine to make sure no ports are being blocked.  


Batch DCOM Approach
File: DCOM.zip
Instructions:
  1. Extract contents of zip file to a temp directory
  2. Ensure all files extracted are on same folder
  3. Ensure user to execute next step is an administrator user
  4. Execute the SetDCOM.bat file. The batch file will use "GetNameBySID.vbs" (identifies required account names, according to installed Window's Native language) provided AS-IS by HPE support and the "dcomperm.exe" (sets permissions to particular DCOM classes with particular accounts) provided by Microsoft to update the DCOM properties of the remote agents for QTP / UFT, BPT, System Test, and VAPI-XP.
Notes:
  • If you apply the batch file, you do not need to implement the steps in Part III - VI below.
  • A system administrator is required to run this batch file across the network to update each Windows machine. \
  • It is expected to see below error if respective feature/application (for example LoadRunner, etc) is not installed (or used yet) on machine when running BAT file:
    ERROR: Cannot open AppID registry key.
    The system cannot find the file specified.
    ERROR: Cannot delete LaunchPermission value.
    The handle is invalid.
    (6)
    ERROR: Cannot delete AccessPermission value.
    The handle is invalid.
Related articles:

Sunday, October 12, 2014

Steps to Upgrade from QC10.XX to QC/ALM 11.XX

Steps to Upgrade from QC10.XX  to QC/ALM 11.XX


1.    Deactivate the project in Global QC 10.

2.    Copy the projects’ repositories from the QC10 server to the ALM Server. Each project has the location of the repository at the project properties in the Site Administration web site.

3.    The DB team will start Copying the project schemas from the old DB instance to the new DB instance.

4.    Once the DB Schema and Project Repository copy has been completed please proceed to restore the repositories in the expected repository location in the QC/ALM 11 instance.

5.    Restore the projects

    1. Login Site Administrator
    2. Go to the Domain and right click and select Restore project
    3. Modify the dbid.xml to match your project environment description before restoring (Example Below).
<?xml version="1.0" encoding="UTF-8"?>
<ProjectDescription>
                        <PROJECT_NAME>PROJECT NAME</PROJECT_NAME>
                        <DB_TYPE>3</DB_TYPE>
                        <DESCRIPTION>(CLOB) Created on 2009-04-15 13:19:40</DESCRIPTION>
                        <DB_CONNSTR_FORMAT>jdbc:mercury:oracle:TNSNamesFile=/home/tgangula/ALM_installation/tnsnames.ora;TNSServerName=qcap11</DB_CONNSTR_FORMAT>
                        <DB_NATIVE_AUTHENTICATION>N</DB_NATIVE_AUTHENTICATION>
                        <DB_NAME>proj_prod17_db</DB_NAME>
                        <DBSERVER_NAME>sa_db_host</DBSERVER_NAME>
                        <DB_USER_PASS>QCC:xxBoKEvANZnaZS1Zcsohjqq9E9hJaeJ3Z1khW8jWhQs=</DB_USER_PASS>
                        <PR_HAS_VCSDB>N</PR_HAS_VCSDB>
                        <PHYSICAL_DIRECTORY>/nfs/apps11/repository/qc/NBCU_105/PROD17/</PHYSICAL_DIRECTORY>
                        <USERS_QUOTA>-1</USERS_QUOTA>
                        <PR_IS_ACTIVE>N</PR_IS_ACTIVE>
                        <SAQ_IS_ACTIVE>N</SAQ_IS_ACTIVE>
                        <VM_REPOSITORY></VM_REPOSITORY>
                        <PR_LANGUAGE>English</PR_LANGUAGE>
                        <PROJECT_TYPE>Standard</PROJECT_TYPE>
                        <IS_TEMPLATE>N</IS_TEMPLATE>
                        <PROJECT_UID>ea7d50f0-ef75-4ffd-9e00-8fc192518707</PROJECT_UID>
                        <PR_SMART_REPOSITORY_ENABLED>Y</PR_SMART_REPOSITORY_ENABLED>
                        <PR_IS_QPM_AUTO_CALC_ENABLED>Y</PR_IS_QPM_AUTO_CALC_ENABLED>
</ProjectDescription>

    1. From the site administrator restore projects using the “dbid.xml” file edited for all projects.

2.    If the project has been successfully restored proceed for upgrade, if not please refer troubleshooting section at the end on the document.

3.    Verify, repair and upgrade projects:

    1. Right click on the project and select “Maintain Project”
    2. Select Verify Project
    3. After verification finished, select Repair project
    4. After project repair, select Upgrade project
4.    After the upgrade has finished successfully please go the logs and verify if the project has been upgraded successfully.
5.    Activate the project.
6.    Login in and perform a smoke test to verify if everything is ok.
7.    If there was any error in Step 6 please refer troubleshooting section at the end on the document.

Troubleshooting:
1.    If you encounter issue with respect DB Permissions issue
a.    Contact DBA and they will be adding space to db

2.    Extra Index Issue
a.    Drop all the extra indexes available from the respective Project Schema
b.    drop index SCHEMA_NAME_HEM_DB.HG_COVER_LWR_IDX

3.    Verification failed with manual repair required
a.    Disable text search and upgrade the project

4.    Smart repository warnings / errors
a.    Manual removal for those files listed in the warning report. The files will be in the repository.

5.    Project is corrupted
a.    Remove and restore the same project

6.    Manual repair
a.    Check Manual Repair Tab

7.    Unable to update/ Lack or rights over the DBID.
a.    Run: chmod 777 [over that folder]

8.    The projects got frozen under "Maintenance" state.
a.    We have to change the state in the DB and then bounce the QC services.

Friday, August 22, 2014

Import XLSX Sheet to UFT/QTP Datatable

Import XLSX Sheet to UFT/QTP Datatable



Most of the people are facing problem with one of the major limitation of QTP/UFT. That is importing data from XLSX extension files. QTP/UFT does not support directly Import option below QTP/UFT 12 versions But using Excel Object Model we can overcome this problem.UFT 12 and above version can support this XLSX extension files.


The below function will import the data from XLSX file to QTP/UFT specified data sheet.

Function ImportSheetFromXLSX(dFileName,dSourceSheetName,dDestinationSheetName)  
  
  Dim ExcelApp  
  Dim ExcelFile  
  Dim ExcelSheet  
  Dim sRowCount  
  Dim sColumnCount  
  Dim sRowIndex  
  Dim sColumnIndex  
  Dim sColumnValue  
  
  Set ExcelApp=CreateObject("Excel.Application")  
     Set ExcelFile=ExcelApp.WorkBooks.Open (dFileName)  
     Set ExcelSheet = ExcelApp.WorkSheets(dSourceSheetName)  
  
  Set qSheet=DataTable.GetSheet(dDestinationSheetName)  
  
  sColumnCount= ExcelSheet.UsedRange.Columns.Count  
  sRowCount= ExcelSheet.UsedRange.rows.count  
  
  For sColumnIndex=1 to sColumnCount  
  
    sColumnValue=ExcelSheet.Cells(1,sColumnIndex)  
    sColumnValue=Replace(sColumnValue," ","_")  
  
    If sColumnValue="" Then  
     sColumnValue="NoColumn"&sColumnIndex  
    End If  
  
    Set qColumn=qSheet.AddParameter (sColumnValue,"")  
  
    For sRowIndex=2 to sRowCount  
     sRowValue=ExcelSheet.Cells(sRowIndex,sColumnIndex)  
     qColumn.ValueByRow(sRowIndex-1)=sRowValue  
    Next  
  
  Next  
  Set ImportSheetFromXLSX=qSheet  
   ExcelFile.Close  
   ExcelApp.Quit  
End Function


There is also another way of overwriting Datatable object to import XLSX files. This is useful for the projects which are already used Datatable.ImportSheet in such many places and now they want to enable XLSX support without modifying QTP/UFT script. Below is the example on how to over write datatable object with newly created class. If you use below code you need to update all existing QTP/UFT datatable object methods and properties.

EnableXLSXsupport()  
DataTable.ImportSheet "C:\Users\thirupathi\Desktop\Data\test.xlsx","Sheet2","Action1"  
  
'********************************************************************************************************  
Function EnableXLSXsupport()  
  
 ExecuteGlobal "Dim QTPDataTable"  
   
 Set QTPDataTable=Datatable  
 ExecuteGlobal "Dim Datatable"  
   
 Set Datatable=New CustomDatatable  
  
End Function  
'********************************************************************************************************  
Class CustomDatatable  
  
 Function ImportSheet(dFileName,dSourceSheetName,dDestinationSheetName)  
  
  Dim ExcelApp  
  Dim ExcelFile  
  Dim ExcelSheet  
  Dim sRowCount  
  Dim sColumnCount  
  Dim sRowIndex  
  Dim sColumnIndex  
  Dim sColumnValue  
  
  Set ExcelApp=CreateObject("Excel.Application")  
     Set ExcelFile=ExcelApp.WorkBooks.Open (dFileName)  
     Set ExcelSheet = ExcelApp.WorkSheets(dSourceSheetName)  
  
  Set qSheet=QTPDataTable.GetSheet(dDestinationSheetName)  
  
  sColumnCount= ExcelSheet.UsedRange.Columns.Count  
  sRowCount= ExcelSheet.UsedRange.rows.count  
  
  For sColumnIndex=1 to sColumnCount  
  
    sColumnValue=ExcelSheet.Cells(1,sColumnIndex)  
    sColumnValue=Replace(sColumnValue," ","_")  
  
    If sColumnValue="" Then  
     sColumnValue="NoColumn"&sColumnIndex  
    End If  
  
    Set qColumn=qSheet.AddParameter (sColumnValue,"")  
  
    For sRowIndex=2 to sRowCount  
     sRowValue=ExcelSheet.Cells(sRowIndex,sColumnIndex)  
     qColumn.ValueByRow(sRowIndex-1)=sRowValue  
    Next  
  
  Next  
   'Set Datatable=QTPDataTable  
   ExcelFile.Close  
   ExcelApp.Quit  
   'Set QTPDataTable=Nothing  
 End Function  
'********************************************************************  
 Function AddSheet(shtName)  
   Set AddSheet=QTPDataTable.AddSheet(shtName)  
 End Function   
'********************************************************************  
End Class  



If you uncomment the Set Datatable=QTPDatatable and Set QTPDatatable =Nothing then this function only works for once. When ever you want to import XLSX sheet then you need to call EnableXLSXsupport() before you use import sheet. This way is for the experts who can handle overwriting of reserved objects. Do remember that If you have not uncommented, the existing datatable methods will not work and you need to define each method in customdatatable class in order to work. You can observe the "AddSheet" method in the above class example

Wednesday, August 13, 2014

How to change the order of Test Plan fields in Quality Center?


Using workflow to change the order of Test Plan fields
Custom workflow is required to change the order of the fields in the Test Plan module. The order is changed using the ViewOrder property.
The ViewOrder must be modified in both the Test_New and Test_MoveTo subroutines.
Fields are displayed Left to Right, Top to Bottom.
See the example below.
Sub Test_New  Remember to also include in the Test_MoveTo subroutine
  • ...
  • Test_Fields("TS_NAME").ViewOrder=10  
     'Test Name fieldTest_Fields("TS_TEST_ID").ViewOrder=20  
      'Test ID fieldTest_Fields("TS_USER_03").ViewOrder=30  
     'Test Focus fieldTest_Fields("TS_USER_04").ViewOrder=40  
     'Test Risk fieldTest_Fields("TS_USER_05").ViewOrder=50  
     'Critical Path fieldTest_Fields("TS_USER_06").ViewOrder=60  
    Test Use fieldTest_Fields("TS_USER_07").ViewOrder=70   
     'Estimated Test Duration
    
  • Test_Fields("TS_RESPONSIBLE").ViewOrder=80 'Designer
  • Test_Fields("TS_USER_01").ViewOrder=90  
      'Created in Project fieldTest_Fields("TS_USER_02").ViewOrder=100  
      'Modified in Project fieldTest_Fields("TS_CREATION_DATE").ViewOrder=110 'Creation Date
    
  • ...
  • End Sub
  • Error when adding a User Defined Field, v11.52


    Error when adding a User Defined Field, v11.52


    When trying to add a custom user defined field in a project that was created originally in Quality Center 9.2 or earlier, a memory protected or corrupted error may occur.
    Workaround:
    Run the following query on the project's schema:
    For SQL Server:
    UPDATE td.SYSTEM_FIELDSET SF_ROOT_ID=NULLWHERE SF_ROOT_ID = 0 ANDSF_COLUMN_NAME <> 'CF_FATHER_ID' ANDSF_COLUMN_NAME <> 'CY_FOLDER_ID'
    For Oracle:
    UPDATE .SYSTEM_FIELDSET SF_ROOT_ID=NULLWHERE SF_ROOT_ID = 0 ANDSF_COLUMN_NAME <> 'CF_FATHER_ID' ANDSF_COLUMN_NAME <> 'CY_FOLDER_ID'

    Loading...