Monday, June 13, 2016

Goals in Maven

The goal you indicate in the command line is linked to the lifecycle of Maven. For example, the buildlifecycle (you also have the clean and site lifecycles which are different) is composed of the following phases:
  • validate: validate the project is correct and all necessary information is available.
  • compile: compile the source code of the project.
  • test: test the compiled source code using a suitable unit testing framework. These tests should not require the code be packaged or deployed.
  • package: take the compiled code and package it in its distributable format, such as a JAR.
  • integration-test: process and deploy the package if necessary into an environment where integration tests can be run.
  • verify: run any checks to verify the package is valid and meets quality criteria
  • install: install the package into the local repository, for use as a dependency in other projects locally.
  • deploy: done in an integration or release environment, copies the final package to the remote repository for sharing with other developers and projects.

Monday, March 23, 2015

Display first 10 factors of a given number

Dim n
n=inputbox ("Enter a number to display first 10 factors")

for i=1 to 10
 msgbox n & " X " & i & " = " & n*i
next

Find the factorial of a given number

Dim n
n=inputbox ("Enter a number to compute factorial")
fact=1
for i=2 to n
 fact=fact*i
next
msgbox "The factorial of " & n & " is " & fact

Print even numbers in a range

Dim n
n=30
for i=1 to n
 if i mod 2 = 0 then
  msgbox "The number: " & i & " is even"
 end if
next

Find whether given number is a odd number

Dim n
n=inputbox ("Enter a number")
if n mod 2 = 0 then
 msgbox "The number: " & n & " is not odd"
else
 msgbox "The number: " & n & " is odd"
end if

Tuesday, June 24, 2014

Common mistakes by QTP tester

Below are the items to make sure you include to avoid mistakes

1. Capture screen for failure steps: Many times we ignore this and many a times we end up in unable to reproduce it. Its safe to capture a screenshot and save it in a location for future reference and escalation

2. Improper reporting: One need to report after each and every step such that the report should look like a test case with all steps in detail

3. Type casting: While comparing the expected and actual value, the values have to be converted and both of them should belong to the same data type to get compared. Else the step fails though the value is correct

4. Mandate Else block: For each If statement there should be an Else statement to ensure the coverage of all the flows

5. Using on error resume next: Many a times the errors go unnoticed due to this line. Ensure that you use On error go to 0 after the block where you think the error will not occur. Else, you need to comment this line every time you debug the code to identify theh exact error

6. Using of Exit for and exit loop: One should use these statement liberally to improve the performance of the script

7. Use .exist with a timeout ex. broswer().page().exist(3) to improve the performance

8. Check the qtp run status or error number before reporting it to the custom report like excel or html, else the actual report would be failed but the custom report shows pass

9. Always clear the local object repository while using share repository as the objects in local repository will be given preference and properties would change and script would fail

10. Delete the Browser chache each time you start the execution so that the latest/updated files would be downloaded from the server.
 
11. Use print instead of msgbox so that if you miss to delete or comment it, print wouldnt stop the execution.

 

Wednesday, March 12, 2014

Capture password from email in outlook using QTP


Consider the message by auto sending "Password service" is as below 

Hi User, 

Please find the credentials below. 

User Name is: name597406 
New password is: KI7UJ6$x^3DIwul 

Note: Please change your password as soon as you login into your application 

Thanks & Regards, 
Admin 

Check the "From" field and note the Display name of the sender and let it be "Password Service" 

The code is as below
Dim olFolderInbox, iTotalMails, sSubject
olFolderInbox = 6 : sSubject = ""
 
Set objOutlook = CreateObject("Outlook.Application")
Set objNamespace = objOutlook.GetNamespace("MAPI")
 
'Create reference to Inbox Folder
Set oInbox = objNamespace.GetDefaultFolder(olFolderInbox)
 
'Find all items in the Inbox Folder
Set oAllMails = oInbox.Items
iTotalMails = oAllMails.Count
 
'Loop through the mail items
For i=1 to iTotalMails
  'Check if the mail is UnRead or not
    If oAllMails(i).UnRead = True Then
'        msgbox oAllMails(i).sendername
        If oAllMails(i).sendername="Password Service" then
            res=split(oAllMails(i).Body,"password is: ")
            res1=split(res(1),"Note:")
            msgbox res1(0)
            Exit for
        end if
    
    End If
Next



AI in Software Testing: How Artificial Intelligence Is Transforming QA

For years, software testing has lived under pressure: more features, faster releases, fewer bugs, smaller teams. Traditional QA has done her...