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

Wednesday, August 13, 2014

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

How to retreive TestLab execution report using Excel Reports


How to retreive Test Lab execution report using Excel Reports



The below query will give you the Testlab execution report wrt Testlab folder Id's


Select CF_ITEM_NAME FOLDER,
CY_CYCLE TESTSET_NAME,
TEST.TS_NAME TEST_SCRIPT,
RUN.RN_RUN_NAME RUN_NAME,
RN_RUN_ID RUN_ID,
RN_STATUS RUN_EXECUTION_STATUS,
RN_TESTER_NAME LAST_TESTER_NAME ,
RUN.RN_EXECUTION_DATE,
TEST.TS_TEST_ID

From CYCLE,RUN,TEST,TESTCYCL, CYCL_FOLD
Where CYCLE.CY_FOLDER_ID=CYCL_FOLD.CF_ITEM_ID
AND TESTCYCL.TC_CYCLE_ID=CYCLE.CY_CYCLE_ID
AND TEST.TS_TEST_ID=TESTCYCL.TC_TEST_ID
AND RUN.RN_CYCLE_ID=TESTCYCL.TC_CYCLE_ID
AND TEST.TS_TEST_ID=RUN.RN_TEST_ID
AND (CYCLE.CY_FOLDER_ID in ('23772')) /*Enter the folder Id of TestLab tree */

Quality Center / ALM site admin password change oracle

Quality Center / ALM  site admin password change oracle


Changing the Site Administrator Schema password for QC installed on Oracle The Site Administrator connects to the Site Admin schema by decrypting the password in the td_siteadmin.xml file, then connects to the database back-end using the decrypted password. Since there is no direct way of changing the Site Admin schema, the instructions below will demonstrate how to generate a new encrypted password and insert that into the td_siteadmin.xml file. An update query will also be needed to change the schema password from the database back-end.Oracle:1. Determine the name of the Site Admin schema.
  1. Log into the Site Administrator.
  1. Navigate to the Site Config tab.
  1. Make a note of the BASE_REPOSITORY_PATH. This is the location of your project repository.
  2.  Example:
    C:\Program Files\Mercury Interactive\Quality Center\repository
  1. C:\Program Files\Mercury Interactive\Quality Center\repository
  1. On the Application Server, navigate to the directory noted in step 1c.
  1. Open the dbcon.txt file under BASE_REPOSITORY_PATH\qc.
  1. Make a note of the database connection string.
  2.  Example:
    qcsiteadmin_db@OracleServer.1521.ORCL
  1. qcsiteadmin_db@OracleServer.1521.ORCL
  1. Note:
  1. The database schema is the first element in the connection string.
2. Create a new database server to get the encryption for the desired password.
  1. Log into the Site Administrator.
  1. Navigate to the DB Servers tab.
  1. Click <New>, and create a new "dummy" database server. You can specify any values you want except the DB Admin Password should be set to the desired password for site admin schema.
  2.  Example
    TEMPORASERVER
  1. TEMPORASERVER
  1. Log into Oracle (SQL Plus) using the Site Admin schema user (the user name found from step 1f).
  2.  Note:
    Please contact 
  1. Please contact 
  2. HP Support to obtain the default password.
  1. Run a query on the dbservers table to locate the row corresponding to the dbserver creates in step 2c, and view the column DB_ADMIN_PASSWORD.
  2.  Example:
    select DB_ADMIN_PASSWORD from dbservers where dbserver_name like 'TEMPORASERVER'
  1. select DB_ADMIN_PASSWORD from dbservers where dbserver_name like 'TEMPORASERVER'
  1. Note:
  1. You will need to make a note of the value specified in this column (it will in format TWO:111-111-11-.....).
3. Stop Quality Center.4. Edit the siteadmin.xml file, and replace the value inside the <DefaultUserPassword> tag with the value noted in step 2e. 5. In the Oracle back-end, change the password for the Site Admin schema user to match the password specified in step 2c.Example:update user qcsiteadmin_db identified by <newpassword>Note: You will need to replace the qcsiteadmin_db with the name of your Site Administrator schema noted in step 1f.6. Restart Quality Center.

Quality Center / ALM LDAP


Quality Center LDAP

How to change the authentication from LDAP to Quality Center when LDAP server is down?

Below are the steps to change the Authentication from LDAP to QC.
1.In the qcsiteadmin_db database, find the PARAMS table.
2. Look for the record where PARAM_NAME = 'Authentication'. Change the PARAM_VALUE to 'QualityCenter'.
3. Look for records where PARAM_NAME starts with 'LDAP', and delete all of them except one 'LDAP_SEARCH_USER_CRITIRIA'.
4. Restart the Quality Center service using the Quality Center icon in system tray.
5. Users should be able to log in using Quality Center authentication.
 

Sending Email from the Quality Center/ALM Workflow


Sending Email from the Quality Center Workflow




 Sending an E-Mail from the Workflow


Purpose: The following code template allows sending any object in TestDirector (Defect, Test, etc.) by e-mail. The code can be used to extend the automatic mail notifications with custom conditions, not available for Send All Qualified. The template uses TestDirector mailing functions.
Code Location:  The code for the each object should be placed in the script of the corresponding module. For example: SendDefect function should be placed in Defects module.

Arguments:
iObjectId – The ID of the object that should be sent (see the note below on how to obtain the object ID).
strTo – The TestDirector names or e-mails of the people that will appear in To field of the e-mail (the names and e-mails should be separated by semicolon. For example: “user@domain.com;admin;alice_td”).
strCc – The TestDirector names or e-mails of the people that will appear in Cc field of the e-mail (the names and e-mails should be separated by semicolon. For example: “user@domain.com;admin;alice_td”). Specify an empty string (“”) to omit this parameter.
strSubject – The e-mail Subject. Specify an empty string (“”) to omit this parameter.
strComment – The e-mail comment (will appear at the top of the e-mail). Specify an empty string (“”) to omit this parameter.
Notes:
1. The object ID value can always be retrieved using the {Object}_Fields collection, by retrieving the Value property of the ID field. The example below shows how to retrieve the Ids of Defect, Test and Requirement:

          ’ Defect ID – for SendDefect
          Bug_Fields(“BG_BUG_ID”).Value
          ’ Test ID – for SendTest
          Test_Fields(“TS_TEST_ID”).Value
          ’ Requirement ID – for SendReq
          Req_Fields(“RQ_REQ_ID”).Value
2. The templates for Defect, Test and Requirement are provided. However the function may be used to work with any object that has Mail function.
3. The third parameter in Mail function allows specifying e-mail options. In the templates below this parameter is hard-coded (its value 2 means that the object History will be sent). However you can change this value to any of the values of TDMAIL_FLAGS. You can use sum to combine the mail properties. For example: 1 – means “send attachments”; 2 – means “send history”. In order to send the mail with attachments and history, specify 3 for this argument.

Return Value:  None

Code Template:

Sub SendDefect (iObjectId, strTo, strCc,
     strSubject, strComment)
On Error Resume Next
Dim objBugFactory, objBug
Set objBugFactory = TDConnection.BugFactory
Set objBug = objBugFactory.Item(iObjectId)
objBug.Mail strTo, strCc, 2, strSubject, strComment
Set objBug = Nothing
Set objBugFactory = Nothing
PrintError “SendDefect
On Error GoTo 0
End Sub
''''''''''''''''''''''''''''''''''''''''''
Sub SendTest (iObjectId, strTo, strCc,
     strSubject, strComment)
On Error Resume Next
Dim objTestFactory, objTest
Set objTestFactory = TDConnection. TestFactory
Set objTest = objTestFactory.Item(iObjectId)
objTest.Mail strTo, strCc, 2, strSubject, strComment
Set objTest = Nothing
Set objTestFactory = Nothing
PrintError “SendTest
On Error GoTo 0
End Sub
'''''''''''''''''''''''''''''''''''''''''''''
Sub SendRequirement (iObjectId, strTo, strCc,
     strSubject, strComment)
On Error Resume Next
Dim objReqFactory, objReq
Set objReqFactory = TDConnection.ReqFactory
Set objReq = objReqFactory.Item(iObjectId)
objReq.Mail strTo, strCc, 2, strSubject, strComment
Set objReq = Nothing
Set objReqFactory = Nothing
PrintError “SendRequirement
On Error GoTo 0
End Sub
''''''''''''''''''''''''''''''''''''''''
Usage Example: In the following example when the test status is changed, the e-mail notification is sent to the designer of the test, cc to all the members of the [QA Testers] group.

          Sub TestPlan_Test_FieldChange(FieldName)
On Error Resume Next
Dim strSubject, strComment
If FieldName = "TS_STATUS" Then 
          strSubject = “Test Change Notification” & _
                             “ for project “ & TDConnection.ProjectName & _
                             “ in domain “ & TDConnection.DomainName
          strComment = “The user “ & User.FullName & _
 “ changed the status of the test ” & _
 Test_Fields(“TS_NAME”).Value & _
 “ to “ & Test_Fields(“TS_ STATUS”).Value
                   SendTest Test_Fields("TS_TEST_ID").Value, _
                                 Test_Fields(“TS_RESPONSIBLE”).Value, “[QA Testers]”, _
                                 strSubject, StrComment
          End If
On Error GoTo 0
End Sub

Loading...