Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Scripting Gmail
#1
Not Solved
I'm trying to create a script using QTP to compose an email in Gmail.
So far I have the login working but am unable to locate the compose mail webElement using descriptive programming. Please take a look at my code and offer any feedback that might help. Thanx.
Here is my code so far...

Code:
Dim ie
Set ie = CreateObject("InternetExplorer.Application")
ie.Visible = True
ie.Navigate "www.gmail.com"

'Define variables for Gmail Home Page
Dim objBrowser, objGmailHmPg, objUser, objPass, objSignIn

'create browser object
Set objBrowser = Description.Create()
objBrowser("title").value = "Gmail: Email from Google - Windows Internet Explorer"

'Create Gmail Home Page object
Set objGmailHmPg = Description.Create
objGmailHmPg("title").value = "Gmail: Email from Google"

'Create user name textbox object
Set objUser = Description.Create()
objUser("html tag").value = "INPUT"
objUser("type").value = "text"
objUser("name").value = "Email"

'Create password textbox object
Set objPass = Description.Create()
objPass("html tag").value = "INPUT"
objPass("type").value = "Password"
objPass("name").value = "Passwd"

'Create sign in button object
Set objSignIn = Description.Create()
objSignIn("name").value = "Sign in"

Browser(objBrowser).page(objGmailHmPg).WebEdit(objUser).Set "xxxxx@email.com"
Browser(objBrowser).page(objGmailHmPg).WebEdit(objPass).Set "password"
Browser(objBrowser).page(objGmailHmPg).WebButton(objSignIn).Click

Set objCompose = Description.Create()
objCompose("innertext").value = "Compose mail"
objCompose("html tag").value = "DIV"

If Browser("title:=Gmail - Inbox.*").Page("title:=Gmail - Inbox.*").Frame("html tag:=IFRAME", "html id:=canvas_frame").WebElement(objCompose).Exist Then
    msgbox "true"
else
    msgbox "false"
End if

ie.Quit
Reply
#2
Not Solved
Hi cbeggs,

I think you should add more property to identify the WebElement

Code:
Set objCompose = Description.Create()
objCompose("micclass").Value = "WebElement"
objCompose("innertext").value = "Compose mail"
objCompose("html tag").value = "DIV"
objCompose("class").Value = "J-K-I-Jz"

Hope to hear you soon.

Ngoc Vo
Reply
#3
Not Solved
I think I know why I'm having trouble accessing this button. It appears that
the Compose Mail button in Gmail is a custom button created by Google.

http://stopdesign.com/archive/2009/02/04...utton.html

So unless anyone here knows anything about this and can help me out, I think I'm going to throw in the towel on this one.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  VB Scripting spixol 0 1,496 12-15-2019, 01:14 PM
Last Post: spixol
  VB scripting Aisha2015 0 2,375 08-07-2015, 02:21 PM
Last Post: Aisha2015
  Regarding Shell Scripting demoqtp 2 4,344 03-31-2015, 12:34 AM
Last Post: demoqtp
  GMAIL Object Identification sidqtp 2 3,601 11-08-2014, 10:12 AM
Last Post: vinod123
Rolleyes Urgent help with Gmail Sending mail feature nidhitaneja 2 2,910 03-05-2014, 09:39 PM
Last Post: nidhitaneja

Forum Jump:


Users browsing this thread: 2 Guest(s)