Tuesday, 2 August 2011

iteration on flight reservation


SystemUtil.Run "C:\Program Files\HP\QuickTest Professional\samples\flight\app\flight4a.exe","","C:\Program Files\HP\QuickTest Professional\samples\flight\app\","open"


Dialog("Login").WinEdit("Agent Name:").Set datatable("uid",1)
Dialog("Login").WinEdit("Password:").Set datatable("pswd",1)
Dialog("Login").WinButton("OK").Click


If dialog("Login").dialog("text:=Flight Reservations").Exist Then
dialog("Login").dialog("text:=Flight Reservations").winbutton("text:=OK").Click
Dialog("Login").WinButton("Cancel").Click

else

    window("Flight Reservation").WinButton("window id:=2").Click
    Window("Flight Reservation").ActiveX("MaskEdBox").Type "121212"
Window("Flight Reservation").WinComboBox("Fly From:").Select "London"
Window("Flight Reservation").WinComboBox("Fly To:").Select "Paris"
Window("Flight Reservation").WinButton("FLIGHT").Click
Window("Flight Reservation").Dialog("Flights Table").WinList("From").Select "1"
Window("Flight Reservation").Dialog("Flights Table").WinButton("OK").Click
Window("Flight Reservation").WinEdit("Tickets:").SetSelection 0,1
Window("Flight Reservation").WinEdit("Tickets:").Set "5"
Window("Flight Reservation").WinEdit("Name:").Set "wewe"
Window("Flight Reservation").WinRadioButton("First").Set
Window("Flight Reservation").WinButton("Insert Order").Click
Window("Flight Reservation").WinMenu("Menu").Select "File;Exit"
 
End If

Wednesday, 20 July 2011

Validation on aCharacter

Dim nChar,s
     s=inputbox("input name")
          nChar = Asc(s)
  
    If nChar >= 65 And nChar <= 90 Then
          msgbox "The first character is UPPERCASE"
    ElseIf nChar >= 97 And nChar <= 122 Then
          msgbox "The first character is lowercase"
         Else
          msgbox "The first character isn't alphabetical"
    End If



OUTPUT:-

The following example uses the InputBox function to display an input box and


Option Explicit
Dim
sPrompt, sTitle, sHelpFile, sRes
Dim
vDef
Dim
sPrompt =
vDef = "
nXPos =
nYPos, nXPos, nContext"Where do you live?" : sTitle = "Personal Data"Israel"100 : nYPos = 100 : nContext = 1001
sHelpFile = "
sRes =
C:\WINDOWS\system32\winhelp.hlp"InputBox(sPrompt, sTitle, vDef, nXPos, nYPos, sHelpFile, nContext)

Sunday, 17 July 2011

How to change character's into ASCII number's

sChars = inputbox("Character")   'enter character
MsgBox Asc(sChars)                  'converstion into no.

Validation Script on characte

=========================================================
Dim sChars
Dim nCharCode
sChars = "QuickTest Professional"
If Len(sChars) > 0 Then
nCharCode = Asc(sChars)
If nCharCode >= 97 And nCharCode <= 122 Then
MsgBox "The first character must be uppercase"
Else
MsgBox nCharCode
End If
End If

===================================================================

Tuesday, 12 July 2011

Simlple Validation on Flight Reservation system.

http://www.nitesh10.blogspot.com



'Leave Username and password field blanck

'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Dialog("Login").Activate
Dialog("Login").WinEdit("Agent Name:").Type micTab
Dialog("Login").WinEdit("Password:").Type micTab
Dialog("Login").WinButton("OK").Click
Dialog("Login").Dialog("Flight Reservations").WinButton("OK").Click

'Again leaves Username field blank

'----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Dialog("Login").WinEdit("Agent Name:").Type micTab
Dialog("Login").WinEdit("Password:").SetSecure "4ab7a2d45ab7f90a0279430e6836a126be044819"
Dialog("Login").WinButton("OK").Click
Dialog("Login").Dialog("Flight Reservations").WinButton("OK").Click

'Enters valid Username
'-----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Dialog("Login").WinEdit("Agent Name:").Set "xyz"

'Again enters invalid Password and then Valid password
'-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Dialog("Login").WinEdit("Password:").SetSecure "4ab7a30e3dbc0045618cadbeddd91a436bba513d3632"
Dialog("Login").WinButton("OK").Click
Dialog("Login").Dialog("Flight Reservations").WinButton("OK").Click
Dialog("Login").WinEdit("Password:").SetSecure "4ab7a3162eda9514506206d258cec02e4e57fb1f"
Dialog("Login").WinButton("OK").Click



http://www.nitesh10.blogspot.com

Tuesday, 5 July 2011

static script for flight reservation system


systemutil.Run "iexplore.exe","www.gmail.com"
browser("name:=Gmail: Email from Google").page("title:= Gmail: Email from Google").webedit("name:=email").Set "abcdefgh"
browser("name:=Gmail: Email from Google").page("title:= Gmail: Email from Google").webedit("name:=Passwd").Setsecure "dsdo947u5juo4u85i459859jkuoit9rr5465ret3s"
browser("name:=Gmail: Email from Google").page("title:= Gmail: Email from Google").webbutton("name:=Sign in").click
browser("name:=Gmail - Inbox").page("title:=Gmail - Inbox").link("name:=Compose Mail").click
browser("name:=Gmail - Compose Mail").page("title:=Gmail - Compose Mail").webedit("name:=to").set "
xyz@gmail.com"
browser("name:=Gmail - Compose Mail").page("title:=Gmail - Compose Mail").webedit("name:=bcc").set "
abc@gmail.com"
browser("name:=Gmail - Compose Mail").page("title:=Gmail - Compose Mail").webedit("name:=subject").set "gmail assignment...,"
browser("name:=Gmail - Compose Mail").page("title:=Gmail - Compose Mail").webedit("name:=body").set "good morning sir..."
browser("name:=Gmail - Compose Mail").page("title:=Gmail - Compose Mail").webbutton("abs_x:=139","abs_y:=251").Click
'browser("name:=Gmail - Compose Mail").page("title:=Gmail - Compose Mail").webbutton("name:=Save Draft","index:=0").Click
'browser("name:=Gmail - Compose Mail").page("title:=Gmail - Compose Mail").webbutton("name:=Save Draft","index:=0").Click


browser("name:=Gmail - Inbox").page("title:=Gmail - Inbox").link("text:=Sign out").click