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

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'

    Limit Test Plan field change


    Limit Test Plan field change


    First create a new user field in Test under Project Entities in Project Customization. This is the field that we will use to hold the user that last changed the field to “Design” once that user has changed the value to Design they should not be able to change the status again. In a sense what we are doing is locking the test when it is changed to “Design” so that the user that last made the change might not try to circumvent the rules by changing the status to something else and then try and jump straight to “Ready”
    I created a field to hold the value of the user that last changed the test to Design so that we can see who changed the status to “Design”, in the workflow I made the field read only so that a user might not try to change the field to “circumvent the rules” of the code and change the value of the Status field. In my environment this field name was ”TS_USER_01” you will need to replace this value in the code with the name of the field that you use to hold the user name.
    In the select case you will need to change the values to match what you have for your “Plan Status” project list, they currently have entries for my “Plan Status” project list. You should not need to include “Design” since it does not matter if the field is changed from “Design” back to “Design” just so that it is not changed to any other status.
    Note: This is just an example, use code at your own risk, you will need to change this code to apply to your environment
    In the workflow code (place the code pieces into the same subs that I did):
    1. Sub Test_MoveTo
    2. On Error Resume Next
    3. Test_Fields.field("TS_USER_01").IsReadOnly=true
    4. On Error GoTo 0
    5. End Sub
    6.  
    7. Sub Test_FieldChange(FieldName)
    8. On Error Resume Next
    9. 'This sets the user name field to the user name that changes the status to "Design"
    10. If Test_Fields.field("TS_STATUS").IsModified=true then
    11. if Test_Fields.field("TS_STATUS").Value = "Design" then
    12. Test_Fields.field("TS_USER_01").IsReadOnly=false
    13. Test_Fields.field("TS_USER_01").Value = User.UserName
    14. Test_Fields.field("TS_USER_01").IsReadOnly=true
    15. end if
    16. End If
    17.  
    18.  
    19. On Error GoTo 0
    20. End Sub
    21.  
    22.  
    23. Function Test_FieldCanChange(FieldName, NewValue)
    24. On Error Resume Next
    25.  
    26. 'This select case ensures that the user that last changed the status to "Design" can no longer
    27. 'change the status of the test. Each case other than "Design" needs an option so that the user
    28. 'cannot change the status once they have changed it to "Design"
    29. Test_FieldCanChange = DefaultRes
    30. Select Case NewValue
    31. Case "Ready"
    32. If FieldName="TS_STATUS" and Test_Fields.field("TS_USER_01").value = user.UserName then
    33. msgbox "Current user has already changed the status to Design and cannot change current status"
    34. Test_FieldCanChange=FALSE
    35. End If
    36. Case "Imported"
    37. If FieldName="TS_STATUS" and Test_Fields.field("TS_USER_01").value = user.UserName then
    38. msgbox "Current user has already changed the status to Design and cannot change current status"
    39. Test_FieldCanChange=FALSE
    40. End If
    41. Case "Repair"
    42. If FieldName="TS_STATUS" and Test_Fields.field("TS_USER_01").value = user.UserName then
    43. msgbox "Current user has already changed the status to Design and cannot change current status"
    44. Test_FieldCanChange=FALSE
    45. End If
    46. End Select
    47.  
    48.  
    49. On Error GoTo 0
    50. End Function

    Loading...