Descriptive Example

''' Descriptive Code for Flight Application Login
Dim a,p,k
Set dl=fn_createobj("text:=Login")
Set a=fn_createobj("attachedtext:=Agent Name:,nativeclass:=Edit")
Set p=fn_createobj("attachedtext:=Password:,nativeclass:=Edit")
Set k=fn_createobj("text:=OK")

with Dialog(dl)
    .WinEdit(a).set "abcd"
 .WinEdit(p).set "mercury"
 .WinButton(k).Click
End With
  
Function fn_createobj(s)
  Dim d
  Set d=Description.Create
     n=split(s,",")
  For i=0 to ubound(n)
         m=split(n(i),":=")
        d(m(0)).value=m(1)
  Next
  Set fn_createobj=d
End Function

=============================
'' Descriptive code to Enter Venkatgn in Google and read the results
 with Browser("CreationTime:=0").page("micclass:=Page")
        .WebEdit("name:=q","html tag:=INPUT","type:=text").Set "Venkatgn"
        .WebButton("name:=Google Search","type:=Submit").Click
 r= .webelement("innertext:=(\d*,\d*){1,}").getROProperty("innertext")
  End With
  msgbox "Total Results   "&r
  Browser("CreationTime:=0").Back
=================================

Comments