08-10-2010, 11:31 AM
Here is the code which is working. Thanks to Anshoo arora the moderator.
Code:
With Browser("title:=Gmail.*").Page("title:=Gmail.*")
If .WebElement("innertext:=Compose Mail", "html tag:=SPAN").Exist(10) Then
.WebElement("innertext:=Compose Mail", "html tag:=SPAN").Click
If .WebEdit("name:=to").Exist(10) Then
.WebEdit("name:=to").Set ""
If .WebEdit("name:=subject").Exist(10) Then
.WebEdit("name:=subject").Set "hi"
Setting.WebPackage("ReplayType") = 2
If .WebElement("innertext:=Send", "html tag:=B", "index:=0").Exist(10) Then
.WebElement("innertext:=Send", "html tag:=B", "index:=0").Click
.Sync
Else
MsgBox( "Send button Not found")
End If
Setting.WebPackage("ReplayType") = 1
Else
MsgBox( "Subject text box Not found")
End If
Else
MsgBox( "To text box not found")
End if
Else
MsgBox( "Compose Mail link not found")
End If
End With