11-23-2009, 01:59 PM
Code:
Dim EditToSearch,EditValueToSet, NumberOfEdits,webButtonToSearch,LinkValueToSet, NumberOfWebButton, EditToSearch4pass,EditValueToSet4pass, NumberOfEdits4pass
'initOutExcel()
'This is the value of the 'name' property for the WebEdit object we want to find.
EditToSearch = "Email"
EditValueToSet = "yourlogin"
'Create a description object to help retrieve all WebEdit objects in a specific page.
Set loginDesc = Description.Create()
loginDesc("micclass").Value = "WebEdit"
loginDesc("name").Value = "Email"
'Retrieve all WebEdit objects in this page
Set EditCollection = Browser("Browser").Page("Gmail: Email from Google").ChildObjects(loginDesc)
NumberOfEdits = EditCollection.Count
'Search for a specific Linkobject and set its value
For i = 0 To NumberOfEdits - 1
If EditCollection(i).GetROProperty("name") = EditToSearch Then
EditCollection(i).Set EditValueToSet
' WriteResults "Enter UserID Succesfully","Gmail User Login","User Enter value"
End If
Next
'Password Entry
'This is the value of the 'name' property for the WebEdit object we want to find.
EditToSearch4pass = "Passwd"
EditValueToSet4pass = "yourpass"
'Create a description object to help retrieve all WebEdit objects in a specific page.
Set passDesc = Description.Create()
passDesc("micclass").Value = "WebEdit"
passDesc("name").Value = "Passwd"
'Retrieve all WebEdit objects in this page
Set EditCollection = Browser("Browser").Page("Gmail: Email from Google").ChildObjects(passDesc)
NumberOfEdits4pass = EditCollection.Count
'Search for a specific Linkobject and set its value
For i = 0 To NumberOfEdits - 1
If EditCollection(i).GetROProperty("name") = EditToSearch4pass Then
EditCollection(i).Set EditValueToSet4pass
'WriteResults "Enter password Succesfully","Gmail password","User Enter value 'password'"
End If
Next
'This is the value of the 'name' property for the Link object we want to find.
webButtonToSearch = "Sign in"
'Create a description object to help retrieve all Link objects in a specific page.
Set webButtonDesc = Description.Create()
webButtonDesc("micclass").Value = "WebButton"
webButtonDesc("name").Value = "Sign in"
'Retrieve all Link objects in this page
Set webButtonCollection =Browser("Browser").Page("Gmail: Email from Google").ChildObjects(webButtonDesc)
NumberOfWebButton =webButtonCollection.Count
'Search for a specific Link object and set its value
For i = 0 To NumberOfWebButton - 1
If webButtonCollection(i).GetROProperty("name") = webButtonToSearch Then
webButtonCollection(i).Click'Set EditValueToSet
End If
'Browser("Browser").Page("Gmail: Email from Google").WebButton(webButtonToSearch).Click
' WriteResults "Login Succesfully","Corporate User Login","User Login With Sysadmin"
Next
If Browser("Browser").Dialog("Security Alert").Exist Then
Browser("Browser").Dialog("Security Alert").WinButton("Yes").Click
End If