Tuesday, 31 May 2016

Automation Transition project questionnaire

Below are few of the points I would suggest for automation transition project questionnaire, though it is varies project to project.

·          Details of tools being used, Add-ins, version and licensing model
·         Provide the list of in scope application and the current automation status (in %) and pass/fail scripts status
·         Provide the list of scenarios (business case E.g. Postpaid customer activation) which are automated end to end
·         Apart form automation tool which other scripts (Perl,shell..etc) are used for automation and for which application?
·         What is current framework? Will this framework be part of transition or it is vendor specific?
·         Provide the details for test case tracebility
·         Provide all completed automation scripts
·         Provide the detail of ongoing task on automation
·         Is their any defined automation scope/target? 
·         Provide the details regarding the integration of automation tool with test mangemnt tool (E.g. HPALM) and any common repository toosl like (SVN/CVS/VSS..etc)
·         Any know issues encountered during automation with respect to environment stability?
·         Any current firewall, connectivity and licencing issue ongoing? How to deal with such issues?
·         In automated test cases what are the manual interventions?
·         What is current approach and frequency of maintaining already automated scope? How much effort does it take?
·         Please let us know the number automation execution request per month
·         Provide the detail of documentation done for automation. Also share the loaction where these documents are stored.
·         Provide the list of interfaces with technolofies in the application if any are being used during automation creation/execution
·         provide the list of dedicated/remote machines list if we are using those already for the automation
·         provide the automation test release report(latest) with all details
·         provide the list defects list if any are being linked to any automatoin scripts (known issues with automation scripts)

Monday, 30 May 2016

SAP Automation tidbits

Below are tidbits used when you are automating SAP applications.


''' Generic function to verify success message displays in status bar
Public Function SAP_VerifySuccessMsg(objSAPWindowName)
On Error Resume Next
Report_WriteStepHeader("<B> Verify Success Message in the statusbar </B>")
SAPGuiSession("SAPSession").SAPGuiWindow(objSAPWindowName).SAPGuiStatusBar("StatusBar").Sync

strSBarSuccessMsg = SAPGuiSession("SAPSession").SAPGuiWindow(objSAPWindowName).SAPGuiStatusBar("StatusBar").GetROProperty("text")

intTransNum = Trim(Split(Split(strSBarSuccessMsg,"Transaction ")(1)," saved")(0))
Print intTransNum
On Error GoTo 0
SAP_VerifySuccessMsg = intTransNum
End Function

''Making fields values empty:
SAPGuiSession("SAPGuiSession").SAPGuiWindow("Purchasing Documents").SelectMenuItemById "DELSCTX"

If SAPGuiSession("SAPGuiSession").SAPGuiWindow("Purchasing Documents").SAPGuiEdit("Purchasing document").Exist(intMinSyncTime) Then
PODefaultValue=SAPGuiSession("SAPGuiSession").SAPGuiWindow("Purchasing Documents").SAPGuiEdit("Purchasing document").GetROProperty("value")
If PODefaultValue<>"" Then
SAPGuiSession("SAPGuiSession").SAPGuiWindow("Purchasing Documents").SAPGuiEdit("Purchasing document").SetFocus
SAPGuiSession("SAPGuiSession").SAPGuiWindow("Purchasing Documents").SAPGuiEdit("Purchasing document").SetCaretPos 0
Set WScript = createobject("WScript.Shell")
WScript.SendKeys "^"+"{A}"
WScript.SendKeys "{DEL}"
Set WShell = Nothing
End If
End If

''''################### to make sure cell is editable in SAP table
BlockCellEditable1=SAPGuiSession("SAPGuiSession").SAPGuiWindow("Change S/O SysB SDI 4").SAPGuiTable("Dates").IsCellEditable(1, "Block")
    If Trim(BlockCellEditable1)="True"  Then
      SAPGuiSession("SAPGuiSession").SAPGuiWindow("Change S/O SysB SDI 4").SAPGuiTable("Dates").SetCellData 1,"Block",""
      SAPGuiSession("SAPGuiSession").SAPGuiWindow("Change S/O SysB SDI 4").SAPGuiTable("Dates").SelectCell 1,"Block"
      SAPGuiSession("SAPGuiSession").SAPGuiWindow("Change S/O SysB SDI 4").SendKey ENTER
 
      If SAPGuiSession("SAPGuiSession").SAPGuiWindow("Information").Exist Then
       SAPGuiSession("SAPGuiSession").SAPGuiWindow("Information").SAPGuiButton("Continue   (Enter)").Click
      End If
    End If

'''############Changing reply mode type

Setting.WebPackage("ReplayType") = 2 'Mouse
Browser("KnowledgeInbox").Page("ReplayType").WebEdit("txtReplayType").Set "KnowledgeInbox"
Browser("KnowledgeInbox").Page("ReplayType").WebButton("Type and enable me").Click
Setting.WebPackage("ReplayType") = 1 'Events
'''############

Sunday, 3 January 2016

Manual Testing with BPT approach in HP ALM

Every body knows BPT(Business Process Testing) can be done with HP UFT/QTP tool with HP ALM. But HP ALM tool has option to support Business Process Testing for manual testing as well. In fact it is quite easy and more structured compare to normal manual testing process in ALM.

Below are the steps how to proceed for that.

1.    Create Business Component in ALM under “Business Components” tab
Steps:
•    Choose “Business Components” tab
•    Select/Create a folder
•    Click on “New Component” (Highlighted in below screenshot)
On the new component window enter details and click on “OK” button

Now under “Manual Implementation” tab create test case steps to prepare manual test case.

Click on “New Step” from above screen(Highlighted). On clicking this it opens “Component Step Details” window
From the “Component Step Details” window enter manual test case step details and Press OK button
2.    Calling Business Component in Test Plan to create Test Case
Steps:
•    Choose “Test Plan” tab
•    Select/Create a folder
•    Click on “New Test” (Highlighted in below screenshot)
In the “New Test” window choose “Type” as “Business Process” option and enter rest of details and click on OK
From above created test click on “Select Components” button to select business components created above
From the components tab(right hand side) Select the required components and click on “Quick Add” button or drag and drop under “test script” pane
3.    Run the test case (manual business components) from Test Lab tab
Steps:
•    Choose “Test Lab” tab
•    Select/Create a folder
•    Click on “New Test Set” (Highlighted in above screenshot)
In the “New Test Window” enter mandatory details and click on “OK” button to generate empty test set.
Form the above created test set click on “Select Tests” button to select test case(business components test case)
From the “Test Plan Tree” pull business process test case and make your business process test set ready
4.    Execute business process test set from Manual Runner
On “BPT Manual Runner” window click on “Begin Run” button to start manual BPT to run
On Clicking “Begin Run” button it opens Business process test with manual test steps details
Enter actual results and make pass/fail the test step and complete the test case execution
After completing the test case execution click on “end Run” and verify the test case status

Thursday, 31 December 2015

SQL query to extract all manual test cases from HP ALM

If  you have used HP ALM tool to store your test cases and when you want to download all test cases in one excel file at the end then it's not so easy to do that activity.

We can overcome that with below sql query by running in Analysis dashboard tab with Excel Report option in ALM.
This activity has to be completed in 2 phases.

1. To get absolute path of folder from where you would like to download test cases.
'''--- to get folder absolute path---
SELECT  AL_DESCRIPTION, /* Level3 Folder Name */ AL_ABSOLUTE_PATH
FROM All_Lists Where AL_ABSOLUTE_PATH

2. Place the absolute path extracted from the above SQL query in below


'''''---- to extract test cases from specific to folder
SELECT
TEST.TS_TEST_ID as "Test ID" /*Test.Test ID*/,
TEST.TS_NAME as "Test Name" /*Test.Test Name*/,
TEST.TS_STATUS as "Status" /*Test.Status*/,
TEST.TS_USER_27 as "Priority" /*Test.Test Case Priority*/,
TEST.TS_USER_44 as "Module" /*Test.Module*/,
ALL_LISTS.AL_DESCRIPTION as "Folder Name" /*Test Plan Folder.Name*/,
TEST.TS_RESPONSIBLE as "Tester" /*Test.Designer*/,
TEST.TS_DESCRIPTION as "Test Description"/*Test.Description*/,
DESSTEPS.DS_STEP_NAME as "Test Step Name" /*Test Step.Step Name*/,
DESSTEPS.DS_DESCRIPTION as "Step Description"/*Test Step.Description*/,
DESSTEPS.DS_EXPECTED as "Expected Results" /*Test Step.Expected*/
From TEST
Join ALL_LISTS On TEST.TS_SUBJECT = ALL_LISTS.AL_ITEM_ID
Join DESSTEPS On TEST.TS_TEST_ID=DESSTEPS.DS_TEST_ID
Where All_Lists.AL_ABSOLUTE_PATH like'AAAAAPAAAAAK%'
ORDER BY TEST.TS_TEST_ID, DESSTEPS.DS_STEP_ORDER



Wednesday, 30 December 2015

HP UFT/QTP issue while performing action on object/element in the application

Have you ever observed an issue when UFT has an object in OR and it is able to recognize during execution but when we try to execute that line there is no action performing on the application

Ex: There is a link on the application and Object for that link is available in the Object Repository
Browser("BN").Page("PN").Link("LN").Click

This object is getting identified by highlighting it and also during the debug mode object is exist. But when we execute above line it is not performing actual action. At the same when we do this action manually it is working fine.

The reason behind is these kind of objects required special care to execute. Usually UFT/QTP executes the scripts by taking over the browser application controls. It is required to ask UFT to use Keyboard/Mouse action as user does manually.

In UFT, we have 2 options to execute scripts
1. Taking over the browser controls
2. Use Keyboard or Mouse contol

UFT by default uses approach as taking over the browser controls directly and performing the script execution. Apparently we have to change execution mode from default to Keyboard/Mouse control mode

Below piece of code does this job for us

Setting.WebPackage("ReplayType") = 2 'Mouse/keyboard mode
Browser("BN").Page("PN").Link("LN").Click

When you done this job you can move back to your previous mode again with below link of code
 Setting.WebPackage("ReplayType") = 1 'UFT mode

I hope this will help us to resolve such issues. Your comments are welcome :)

Tuesday, 29 December 2015

Making HP UFT/QTP compatible with Chrome - Manually installing UFT add-on over Chrome browser



First and foremost  step we have to follow to make UFT compatible with Chrome is to check Browser support matrix. Please refer the link to check compatibility Link

Sometimes though Chrome version falls in support matrix list, UFT couldn't identify objects. 
There could be 2 reasons. 
1. Any left over UFT Add-ons available from previous versions
2.UFT installation not done properly and hence no UFT add-on installed on Chrome browser.
In both cases below solution works. Please refer this.

The steps to manually install Web Add-in Agent for Chrome are:
  
  1. Locate the Agent.crx to install.

    Note: If installing default version offered by presently installed QuickTest Professional (QTP) / Unified Functional Testing (UFT), search under <QTP/UFT>\bin\Chrome

    For Example: C:\Program Files (x86)\HP\Unified Functional Testing\bin\Chrome 
  2. Create a copy of the Agent.crx file you see in the above folder and rename the copied file extension to Agent.zip (Keep the copied file in the same folder as the Agent.crx file) 
  3. Extract Agent.zip to a folder called Agent 
  4. Verify that the above steps ran correctly 
    1. Your <UFT_INSTALLATION_FOLDER>\bin\Chrome folder should now look like:
       
    2. The folder <UFT_INSTALLATION_FOLDER>\bin\Chrome\Agent should include the following file/directory:
      1. Agent [Directory]
      2. Manifest.json 
  5. Start Chrome
  6. Access the Extensions listing:
    1. Navigate to the URL: chrome://extensions

      Or...
    2. Go to Chrome menu (ALT+F) > Tools > Extensions 
  7. (Important) If there is already a present QuickTest Professional (QTP) / Unified Functional Testing (UFT) Agent extension remove it
    Restart Chrome
  8. Ensure Agent is not listed under "Extensions"
  9. Enable Developer Mode by checking the “Developer Mode” option in the Extensions page
  10. Click on the “Load unpacked extension” button. 
  11. In the “Browse For Folder” dialog, select the folder <UFT_INSTALLATION_FOLDER>\bin\Chrome\Agent (same folder that was created in Step 3)  
  12. Confirm the new extension by clicking the “Add” button in the “Confirm New Extension” dialog
  13. You should now see the Unified Functional Testing Agent extension in the Chrome Extensions list
     
  14. Restart Chrome (This step is very important!)
Note: If you encounter a popup after starting Chrome, make sure you click on Cancel (or you can simply ignore it). Do NOT click on Disable.

HP UFT/QTP to make compatible with Mozilla

If you are having issues with UFT/QuickTest Professional recognizing Firefox, it could be because the patch installation was not able to make the appropriate modifications in the Program Files directory due to security restrictions presented by Windows7 (even if you have Administrator rights).  In this case you have to make the changes yourself with Administrative rights, and manually modify the directory and approve the security warning dialog boxes.

Getting QuickTest Pro and Firefox to work together is not difficult, but you do have to perform a couple of system modifications.  This post will discuss getting QTP v12.02 to work with Firefox up to v33 on Windows7.

Environment:
Windows7, QTP v12.02 2, Firefox up to version 33

Steps so that Firefox sees QTP:
1.Open Windows Explorer
2.Navigate to the folder where your QuickTest Pro is installed and expand the following folder underneath it: <QTP Installation>binMozilla
3.You should see a structure like in the image below.  Notice how there is now a sub-directory called “Common” with the new supported Firefox versions.QTP Directory


4.Now click on the “Common” directory and you will see a file called “install.rdf”, open this file in Notepad.
5.In the “install.rdf” file you want to copy the “em: id” under the top section which is specifying QuickTest Professional (I highlighted it in this image; do not confuse it with the “em: id” in the bottom section which relates to Firefox itself).Install RDF

6.Open another Notepad window and save it using the “em: id” from the step above as the file name (do not save it with an extension).  Now paste the full directory name to the “common” directory where QTP is installed in the contents of this new file.  The directory should look something like “C:Program FilesHPQuickTest ProfessionalbinMozillaCommon”.
7. Save the file and close it.  (It’s easier to do this process in a temporary directory due to security in Windows7, instead of in the final directory.)
8. In Windows Explorer, navigate to the folder where Firefox is installed (on my system that is “C:Program Files (x86)Mozilla Firefox”) and click on the sub-directory called “extensions”.
9.Now perform a click and drag of the file you created above in the temp directory, into this “extensions” directory.  Windows7 will prompt you with a security dialog box saying you have to have Administrator rights to do this.  Click the Continue button as long as you do (this whole process will only work if you are logged into your machine with Administrator rights).Firefox Directory

10. Now open the Firefox browser. Go to Tools -> Add-ons and you should now see the “QuickTest Professional X.X Plugin” is enabled.Firefox Addons
11. In Firefox, navigate to Google.
12.With QuickTest Pro, open the Object Spy and spy on the google search edit field.  QTP should now see the objects in your Firefox browser. In case the object is still identified as Window, make sure your firefox version is supported by the current UFT/QTP version