Tuesday, July 15, 2008

Type of Checkponits

  • Standard Checkpoint checks the property value of an object in your application or Web page. The standard checkpoint checks a variety of objects such as buttons, radio buttons, combo boxes, lists, and so forth,support for all add-in environments
  • Image Checkpoint checks the value of an image in your application or Web page,support for the Web add-in environment
  • Image Checkpoint checks the value of an image in your application or Web page
  • Bitmap Checkpoint checks an area of your Web page or application as a bitmap
    Table Checkpoint checks information within a table
  • Text Checkpoint checks that a text string is displayed in the appropriate place on a Web page or application.
  • Text Area Checkpoint checks that a text string is displayed within a defined area in a Windows application, according to specified criteria.

Understanding Checkpoint

  • QuickTest enables you to add checks to your test. A checkpoint is a verification point that compares a current value for a specified property with the expected value for that property. This enables you to identify whether your Web site or application is functioning correctly.
  • You can also use the CheckProperty method and the CheckItemProperty method to check specific property or item property values
  • Example : a = Browser("MyBrowser").Page("MyPage").Check (CheckPoint("MyProperty"))

Understanding Object Repository

  • Test objects can be stored in two types of object repositories—a shared object repository and a local object repository. A shared object repository stores test objects in a file that can be accessed by multiple tests (in read-only mode).
  • A local object repository stores objects in a file that is associated with one specific action, so that only that action can access the stored objects.

Adding Other Types of Steps to Your Test

  • You can insert a checkpoint and output value
  • You can insert comments in steps to separate parts of an action
  • You can insert Report events, commentsline and Synchronizes Call Qtp Script and Winrunner test/function
  • You can control the flow of your test by using conditional and Loop statements

Define the Keyword View

  • You can use the Keyword View to add new steps to your test and to view and modify existing steps. When you add or modify a step, you select the test object or other step type you want for your step.
  • select the method operation you want to perform, and define any necessary values for the selected operation or statement.
  • Working in the Keyword View does not require any programming knowledge. The programming required to actually perform each test step is done automatically behind the scenes by QuickTest.
  • The following columns: Item, Operation, Value, Assignment, Comment, and Documentation

How QuickTest Learns Objects While Recording

  • First, it "looks" at the object on which you are recording and stores it as a test object, determining in which test object class it fits
  • For each test object class, QuickTest has a list of mandatory properties that it always learns;
  • When you record on an object, QuickTest always learns these default property values, and then "looks" at the rest of the objects on the page, dialog box, or other parent object to check whether this description is enough to uniquely identify the object. If it is not, QuickTest adds assistive properties, one by one, to the description, until it has compiled a unique description

Get Value from Note or Mesage in Orale Apps

Dim id,stchr,endchr
id = OracleNotification("Decisão").GetROProperty( "message")
stchr = instr(1,id,"= ")
endchr = instr(1,id,")")
id = mid(id,stchr+2,endchr-stchr-2)

Query the Data in Oracle Form Window

OracleFormWindow("NFFs").OracleTextField("Tipo").InvokeSoftkey "ENTER QUERY"

OracleFormWindow("NFFs").OracleTextField("Fornecedor").Enter Parameter("Fornecedor")OracleFormWindow("NFFs").OracleTextField("Local").Enter Parameter("Local")OracleFormWindow("NFFs").OracleTextField("Data da NFF").Enter Parameter("data_NFF")OracleFormWindow("NFFs").OracleTextField("Fornecedor").InvokeSoftkey "EXECUTE QUERY"

Cancel the Note Function in Oracle Apps

function note()
Dim Message
If OracleNotification("title:=Note").Exist Then
Message = OracleNotification("title:=Note").GetROProperty("message")
reporter.ReportEvent micWarning, "Note Message: ", ""&Message OracleNotification("title:=Note").Approve
note = 1
Else
note = 0
End If
End Function

Compare Date Function

Function Compare_Date(InacDate,CurrentDate)
If int(year(InacDate) ) > int(year(CurrentDate) )Then
Comp = 0
Else If int(year(InacDate) ) = int(year(CurrentDate) )Then
If int(month(InacDate) ) > int(month(CurrentDate) )Then
Comp = 0
Else
If int(month(InacDate) ) = int(month(CurrentDate) )Then
If int(day(InacDate) ) > int(day(CurrentDate) )Then
Comp = 0
Else
Comp = 1
End If
Else
Comp = 1
End If
End If
Else
Comp = 1
End If
End If
End Function

Open the browser

Function OpenBrowser(StartURL) strTestDrive=getTestDrive()
loadRepository("Test.tsr")
Set IE = CreateObject("InternetExplorer.Application")
IE.Visible = true
If Browser("Browser").Exist Then
Browser("Browser").Close End If SystemUtil.Run "iexplore.exe","","","" Wait (2)
hwnd = extern.GetForegroundWindow()
hwnd = extern.GetForegroundWindow()
Window("HWND:=" &hWnd).Maximize
IE.Navigate StartURL Browser("Browser").Navigate StartURL
End Function

Function to open the data sheet

Public Function OpenDataTable(strFileName,strSheetName)
CurPath=environment("TestDir")
pathArr=split(CurPath,"\") CurDrive=pathArr(0) pathFile="\nxc Automation\Data Table\"
dataTablePath=CurDrive + pathFile strFilePath=dataTablePath+ strFileName
DataTable.ImportSheet strFilePath,strSheetName,"Global"
End Function

String without Spaces

public function Stringtrim(in str)

Dim len,ret,start,end; len=length (str)

for(start=1;start<=len;start++) if(substr(str,start,1)!=" ")

break

for(end=len;end>1;end--)

if(substr(str,end,1)!=" ")

break

return substr(str,start,len-start-(len-end)+1)

End Function