08-09-2010, 04:02 PM
I never thought I have to struggle 12 hrs to automate ‘compose mail’ functionality in gmail. But still I am unable to execute it successfully. I have been struggling to identify the objects of ‘compose mail link”, “To text box”, “subject text box”, “send button”. I can understand it is a simple issue but in real I am struggling,
The code i am using.
'*****************************************************
'***************************************************
In some runs, some of the objects are being identified by QTP and in the next run same objects are not being identified.
I thought i would use Object repositary to store the objects and get them identified. But the above mentioned objects are lying under frames whose name starts with 'c'. So i cant use c.* for all the frames.
Note: Before you suggest any code, please run it once on gmail and if it is passing then only put down here. Otherwise i end up loosing more time in implementing your code.
In some posts i read use the below to click on compose mail
but i didn't work
Thanks,
kishore
The code i am using.
'*****************************************************
Code:
If Browser("title:=Gmail.*").Page("title:=Gmail.*").WebElement("innertext:=Compose Mail", "html id:=:rd", "html tag:=B").Exist Then
Browser("title:=Gmail.*").Page("title:=Gmail.*").WebElement("innertext:=Compose Mail", "html id:=:rd", "html tag:=B").Click -9999, -9999
Browser("title:=Gmail.*").Page("title:=Gmail.*").Sync
If Browser("title:=Gmail.*").Page("title:=Gmail.*").WebEdit("name:=to", "class:=dK nr l1", "rows:=2").Exist Then
Browser("title:=Gmail.*").Page("title:=Gmail.*").WebEdit("name:=to", "class:=dK nr l1", "rows:=2").Set "<xyz@gmail.com> "
If Browser("title:=Gmail.*").Page("title:=Gmail.*").WebEdit("name:=subject").Exist Then
Browser("title:=Gmail.*").Page("title:=Gmail.*").WebEdit("name:=subject").Set "hi"
If Browser("title:=Gmail.*").Page("title:=Gmail.*").WebButton("name:=Send").Exist Then
Browser("title:=Gmail.*").Page("title:=Gmail.*").WebButton("name:=Send").Click -9999, -9999
Browser("title:=Gmail.*").Page("title:=Gmail.*").Sync
Else
MsgBox( "Send button Not found")
End If
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
'***************************************************
In some runs, some of the objects are being identified by QTP and in the next run same objects are not being identified.
I thought i would use Object repositary to store the objects and get them identified. But the above mentioned objects are lying under frames whose name starts with 'c'. So i cant use c.* for all the frames.
Note: Before you suggest any code, please run it once on gmail and if it is passing then only put down here. Otherwise i end up loosing more time in implementing your code.
In some posts i read use the below to click on compose mail
Code:
Browser("title:=Gmail.*").WebElement("html id:=:rd").Click
but i didn't work
Thanks,
kishore