Posts

Showing posts from September, 2016

Time Slots reservation in HP ALM

Image
In this post I will be showing how to setup the time slot for the testing hosts, so that testers will not face any unavailability of testing hosts at the time they require to run there automated test scripts. After navigating to TimeSlots tab in ALM, user needs to add a new time slot for his tests as shown in below image: After clicking the new timeslot a new window will come where you need to fill all the required details. 1. Run - You need to select which type of test you want to run "Functional Test Set", "Performance Test" or "Build Verification Suite" 2. Start: User need to select whether he wants the execution to start manually or automatically in this timeslot. 3. Name: User need to provide the name of the timeslot 4. Select a test set: User need to browse through the test sets and select the test set which he wants to execute if any. 5. Duration , Start Time and End Time: User needs to provide the duration of the time slot and...

How to calculate the execution time for few steps without scripting in UFT?

Image
Sometimes we want to find out time consumed by certain number of steps while executing in test automation scripts and we end up either by adding up time for each step or scripting using the date and time feature. But QTP/UFT has provided a functionality called as "Transaction" which can be used to calculate the time spent between those steps. We need to start the transaction before the first step and need to end the transaction after the last step of the set of steps which we want to analyse. Either you can write the below lines or you can insert using the QTP tool bar.  Services.StartTransaction  "<user defined name>"  Services.EndTransaction  "<Same name as given in start transaction>" Below image shows how the transaction details shows in the results.

Descriptive Programming or Object Repository in UFT

There is always a discussion about what to use between descriptive programming or objective repository to identify the objects with QTP/UFT. And nowadays testers are going more towards descriptive programming instead of having knowledge about its advantages and disadvantages. I am writing not against any methodology but putting my perspective about when to use descriptive or object repository. The first reason users always give with descriptive programming that it is used when object is dynamic. But don't we have regular expression functionality in object repository which can also handle the dynamic objects. And you can write any logic to find the property and same property can be set to the test object using SetTOProperty method. Also the setting of object identification in QTP resolves most of the issues with the object identification. The second reason users give is about the speed. This is also a misconception, as qtp works faster with object repository in comparison t...

VB script code to change the field of a test case in ALM

Below code helps in updating the data of any field of multiple tests uploaded in ALM without logging into the ALM. You just need to feed the name of the test cases , folder path and ALM credentials.  I have passed all the data from excel and created a macro in same excel using the below code.     Set td = CreateObject("TDApiOle80.TDConnection")     Dim rng As Range     RowCnt = Sheets("Sheet2").Range("A1").End(xlDown).Row     ALMUrl = Sheets("Sheet1").Range("B1").Value     ALMDomain = Sheets("Sheet1").Range("B2").Value     ALMProject = Sheets("Sheet1").Range("B3").Value     ALMUserId = Sheets("Sheet1").Range("B4").Value     ALMUserPwd = Sheets("Sheet1").Range("B5").Value      RowCnt = Sheets("Sheet2").Range("A1").End(xlDown).Row     '=========================================     Set tdc = CreateO...

VB Script code to upload multiple test in ALM without any Manual intervention

Below code can be used within excel also as a Macro and the details required for the ALM connection and list of tests with the ALM folder where tests needs to be updated. 'Gets the count of the QTP tests needs to be uploaded in ALM RowCnt = Sheets("Sheet2").Range("A1").End(xlDown).Row 'Credentials required to connect QTP with ALM ALMUrl = Sheets("Sheet1").Range("B1").Value ALMDomain = Sheets("Sheet1").Range("B2").Value ALMProject = Sheets("Sheet1").Range("B3").Value ALMUserId = Sheets("Sheet1").Range("B4").Value ALMUserPwd = Sheets("Sheet1").Range("B5").Value 'Below steps makes QTP connection with ALM using the above credentials Set objQTP = CreateObject("QuickTest.Application")     If Not objQTP.TDConnection.IsConnected Then         objQTP.TDConnection.Connect ALMUrl, ALMDomain, ALMProject, ALMUserId,                           AL...

What is the difference between Call to copy of Action and Call to existing action in QTP/UFT?

There are 2 ways in UFT/QTP where you can call the external actions in a new test. The first option is Call to copy of action, in this option the copy of the action will be copied over to the test and there will be no reference to the original action. All the resources of the action like repository or data table will also be copied. And if you do any changes in the action it will not be reflected in the other test. The second option is Call to existing action, in this option QTP just creates a call to the action but the resources will not be copied over. And user will not be able to edit the action in the new test. If you edit the action in the original test then those changes will be reflected in the tests wherever the action is called. There were some scenario's i have seen where testers have used the call to existing action but when the original test with action is shifted to some other location, they haven't changed the location in the test where the action is calle...