Vb-scripting Abs value function

In this series we are going to discuss Vb-Scripting functions in UFT( Advance Quick Test Pro), our main focus will be on important functions, that are frequently  used in practical scenarios.



Function Name:- Abs

Meaning :- Used to return Absolute value of a number

  • Number should be valid numeric expression, else zero or Script error is returned

Syntax:- Abs(Number)

Example:-

  • Dim iNum1, iNum2 : iNum1 = 2013.09 :  iNum2 = – 2013.09
  • Msgbox Abs(iNum1 ) ‘ Returns 2013.09
  • Msgbox Abs( iNum2 ) ‘ Reruns again 2013.09
  • Msgbox Abs(uftHelp)  ‘Returns 0
  • Msgbox  Abs()   ‘Returns Script Error
  • Msgbox Abs(@@@) ‘ Returns again Script Error

Working with Reporter Object, MsgBox and Print Statement in UFT?

Following video tutorial covers the mostly used scenario’s for reporting results in UFT/QTP.

For reporting in Selenium we need ReportNG

Just a brief summary of topics that are highlighted inthe video, firstly we discussed the usage of “MsgBox and Print Statements” with their differences and then our main focus was on “Reporter Utility Object“,in this we focused on “ReportEvent and ReportNote” methods and “Filter,RunStatus and RepotPath” properties.


MsgBox
Print
Vb-scripting Feature UFT , utility statements
Information displayed using Popup Information is displayed in Print Log file
Script execution stops when it is displayed Script execution is not interrupted
MsgBox(“Welcome to uftHelp.com”) Print “Welcome to uftHelp.com”



We also discussed what is a utility object and utility statements in uft/qtp, than we did the syntax of “ReportMethod” 

Reporter.ReportEvent EventStatus, ReportStepName, Details [, ImageFilePath] 

EventStatus:-Status of Run Result 

  • 0-micpass
  • 1-micfail 
  • 2-micdone 
  • 3-micwarning 
ReportStepName:-Name of the step to be displayed in Result Viewer
Details:-Description of ReportStepName
Imagefilepath:-Optional, path of the image that need to be displayed

Example:-

Reporter.ReportEvent 0, “uftHelp.com”, “Helping Ppl Learn

Examples of ReportNote, Run Status, ReportPath and Filter are also shown in the video

Incase video doesnot load, please follow the YouTube link



How Facebook tests Facebook?

Thought of sharing a video “How facebook test facebook on Android“, this is taken from GTAC-2013(The Google Test Automation Conference (GTAC) is an annual test automation conference hosted by Google. It brings together engineers from industry and academia to discuss advances in test automation and the test engineering computer science field)




Hope you will learn how things are implemented in bigger prospective.

Addin for Multibrowser support in QTP

Automation Samurai, company came with new version of QTP addin which supports running of QTP scripts on latest versions of browser platform like:-
  • Safari
  • Chrome 
  • Firefox
  • HTMLUnit
  • Opera
It also supports mobile testing of  iPhone, iPad and Android (support for emulators and actual devices).
For more please refer the link “Automation Samurai”.
Please share your feedback on this addin so that it is helpful to testing community.

Descriptive Programming in UFT

Please refer the below video, it covers basics of DP, How to use DP, Practical Examples of DP, Types of DP , Limitations of DP.

What is DP?

  •  Descriptive programming 
  •  Smart way of automation testing in UFT



  Where to Use?

  •  Objects in application are dynamic 
  •  OR size is increasing
  •  Don’t want to use OR
  •  OR is in read only mode 
  • Working with similar type of objects



Static DP?

  • Object information is send directly into the script
  •  “PropertyName” :=“Property Value” Pairs
  •  Browser(“creationTime:=0”).click



  Dynamic DP?

  • Description object to return a properties collection 
  • Set obj = description.create 
  • obj(“PN”).Value = “PV” 
  • Browser(obj).click



Usage Constraint 

  • When using DP from a specific point within a test object hierarchy, you must continue to use programmatic descriptions from that point onward within the same statement 

                Window(“Calculator”).WinButton(“Window Id:=2”).click (Correct)
                Window(“Window id:=123”).WinButton(“2”).click (Wrong)

  •  Property objects added to a Properties collection are treated as regular expressions.


Meaning of DP in UFT
Example1
Example2
Example3