Friday, April 29, 2016

Someone might have accidentally deleted the Test scripts/ Test Runs/ Defect even then no need to worry since we found a solution to retrieve deleted artifacts in HP ALM/QC


Did you ever got into a situation where you are pressurized to retrieve the deleted artifacts in ALM and when you looked at DB backup those records are there. No need to worry if your backend is oracle.

When we got into this situation below are SQL statements which we have executed to retrieve the deleted test scripts in Test Plan module.
 
Below are Queries which you can execute it to retrieve the deleted test scripts in the test plan module. If you want to test these follow the below steps.

Create a test folder and underneath create test scripts in test plan module. Delete the folder and then execute the following queries by updating the date and time when those test scripts are created.

insert into test
SELECT * FROM TEST as of timestamp to_timestamp('26-03-2016 12:27','DD_MM_YYYY HH24:MI') where ts_test_id not in (select  ts_test_id  from TEST)

insert into TEST_CONFIGS
SELECT * FROM TEST_CONFIGS as of timestamp to_timestamp('26-03-2016 12:27','DD_MM_YYYY HH24:MI') where tsc_test_id not in (select  tsc_test_id  from TEST_configs)


insert into TEST_CRITERIA
SELECT * FROM TEST_CRITERIA as of timestamp to_timestamp('26-03-2016 12:27','DD_MM_YYYY HH24:MI') where tcr_test_id not in (select  tcr_test_id  from TEST_CRITERIA)


 
 

 

Monday, April 25, 2016

QC/ ALM – Bug. As an end user we say it is Bug but HP says that’s how the product is designed and they say it’s a client specific requirement.


This is the story of one of fortune 100 HealthCare company. Since they are into HealthCare business, any application which is either directly or indirectly dealing with the patient related information it should be a validated system, meaning should comply with CFR part 12 FDA guidelines.  For these applications Quality Center/ ALM tool is being used for the test management hence as per the requirements QC/ALM should be validated.

 

Robust workflows are created using QC/ALM customization to comply with FDA guidelines and satisfy the compliance requirement.  These workflows are working fine if the end users are trying to perform any action (correctly restricting the update/delete of approved entity) using front end UI. And the problem comes in when all the rules are bypassed if the users are trying to update an approved entity using excel plug-In. We got into a situation where we need to disable the excel upload feature to the end users and allow it only to specific users(ALM administrators).

 

Below is the trigger which is being deployed to accomplish.

 create or replace TRIGGER Val_user

BEFORE INSERT ON PROJECT_SESSIONS

FOR EACH ROW

 
DECLARE

 CType varchar(255);

uname varchar(255);
 
BEGIN

select LS_Client_Type,LS_USER_NAME into CType,uname from Login_Sessions where ls_id=:New.ps_ls_id;


IF  CType= 'OTAClient' and uname not in(‘<User Name>’) and

((instr(:New.PS_PROJECT_NAME,'_GxP') >1))) then

               RAISE_APPLICATION_ERROR(-20000, 'Y');

End if; 

END;

 

Saturday, May 11, 2013

Perfromance Testing.


What is performance testing all about?
  • Let me give you a real time example that if you want to check your balance in an ATM center you will insert your card in ATM and the ATM machine will ask you to enter your PIN number after validating that information it will ask you to select what type of transaction you would like to make.
  • In the above example what if ATM machine is taking around 15 minutes to ask your PIN and so on…
  • Will you be able to wait such a long period and will show interest in using that ATM again.
  • Answer for that without second thought is NO.
  • It means performance of the application is poor so performance is directly propositional to the response time. Unfortunately most of the developers including me will not follow the coding standards that resulting in poor performance.
  • If the client requirement is to add 2 numbers, being a developer I may or may not follow the coding standards while declaring variables and also defining the formula but I will make sure that it will accept the input values from the user and will give the result by adding those 2 numbers but there is no guaranty that this will work if “N” numbers of users are using it at a time. Unfortunately I am least bothered about it.

Who (Business Owner/Development Lead/Testing Lead/Developer/Tester) is responsible for it?
  • Everyone is responsible for this. But unfortunately nobody will take the responsibility of it.


Thursday, August 16, 2012

Quality Center LDAP Authentication


Important distinction should be made when working with LDAP. There are two phases. First is the import. In this phase you need an LDAP account that has the privileges to import users. Of course, an ‘admin’ of the LDAP is the best suitable.

The second phase is the actual usage of the imported account by the QC user. In this phase, the user does not make usage of the "importer" LDAP account. QC delegates the user's DN ('Distinguished Name' – a unique user identifier) as imported before to the LDAP and grants or denies access according to the LDAP reply.

The user's password is not stored in QC - it is managed by the LDAP. When a user password is modified in the site, QC does not need to know about it.

Importing users from LDAP:

  1. Obtain the URL of your LDAP server and enter it in the ‘Authentication Settings->Directory Provider URL’. The URL convention is: ldap://myserver:port. You can use this convention in the following combinations:

'<Server name>'
'ldap://<server name>'
'ldap://<server name>:<custom port>'

·         Check with LDAP administrator if secure LDAP is used. In this case you might need to use ‘ldaps’ when creating the connection (‘ldaps://<server name>’).
·          The default ports for LDAP are 389 (regular) and 636 (secure)
·         This check verifies only the connection URL, not access rights.

  1. Once you have successfully established a connection you can continue to importing users. Open the ‘LDAP Import Settings’ Dialog.
  2. ‘Directory Provider URL’ will be similar to what you have used in the previously in ‘‘Authentication Settings’
  3. Depending on your site policy you can choose between  ‘Anonymous’ account if that was set with sufficient privileges to import users or you must obtain a user account that was given appropriate grants. Notice that in sites using security it is not likely that ‘Anonymous’ will have sufficient grants.
  4. If ‘Anonymous’ is not used then a ‘Simple->Authentication Principle’ account is to be used. LDAP identifies any object (a 'user' object in our case) in the tree as a path combination of nodes from current node to root node. This unique string combination is called a DN (distinguished name). For example, consider the below screen shot of an LDAP tree, that starts with a domain called 'CSOIL'.


  1. In this example the ‘Administrator’ 'node' is a DN combined of the 'nodes' going from end to start:

'CN=Administrator, CN=Users, DC=CSOIL' 

·         The above DN is partial path only. In real example it will be with more root elements.
·         You will need to ask your LDAP admin for the DN to authenticate with.


  1. In order to understand more about LDAP terminology find table below with famous  LDAP abbreviations and terms that are usually concerning an object of type 'user':

LDAP term
Explanation
CN
Common Name. CN is the combination of First name and last name. Attribute is made up from givenName joined to SN (surname).

For example:
CN=Yariv Gadish
DN
Distinguished Name. DN is simply the most important LDAP attribute.

For example:
CN=Yariv Gadish, OU=CSO ,DC= CO ,DC=IL
OU
Organizational unit.

For Example:
OU=CSO
DC
Domain Components.

For example:
DC=IL
SN
SN is the last name or surname.

For example:
SN=Gadish
sAMAccountName
sAMAccountName is the NT 4.0 logon name.

For example:
sAMAccountName=gadishy
userPrincipalName
userPrincipalName. Often abbreviated to UPN, and looks like an email address. 

For example:
userPrincipalName=yariga@mercury.com   
givenName
Firstname also called Christian name
name
Name.  The same as CN.

Example:
name=Yariv Gadish


  1. After completing the first dialog of ‘LDAP Import Settings’ the next screen will ask you for more details.
  2. ‘Directory base’. Here you can choose if you want to import from the root of the LDAP tree, or from a sub node.
  1. Another way to filter objects is to use the ‘Base Filter’. Here you can specify classes that will fit certain objects only. You can use logical ‘OR’ (‘|’) and/or ‘AND’ (‘&’) to create a condition made of several sub conditions.

For example, search for users which are defined of class ‘user’ or of class ‘person’:

(|(objectClass=user)(objectClass=person))

Another example - Search for a Single User:

(&(|(objectClass=user)(objectClass=person))(CN=Yariv))

Note that:
·         The logical operator joining the conditions is at the start of the statement.
·         A user entity might be defined as made of different ObjectClass.



  1. Next you have two possible buttons, ‘Set Default for Active Directory’ and ‘Set Default for LDAP’. Pressing this buttons will set the field mappings between the LDAP user and the imported QC user. As the name of the buttons implies, these will set the mappings to the default standards used in either category. Note that ‘Active Directory’ means the Microsoft implementation for LDAP.
  2. If you do not have default names used for your user objects, you need to click the ‘advanced’ button.
  3. In the ‘advanced->Field Mapping’ dialog you can specify your naming conventions as used on your LDAP server.