• Register
Win an IPAD!!! Checkout this page!
x

Gmail Automation

0 votes

 

Gmail Automation:

Clicking on Inbox Link without Using Regular Expression: (Using Object Repository)

 

1.     Launch IE Browser as URL www.gmail.com

2.     Provide Valid Credentials to Gmail to login to application.

3.     Open Object Repository (Ctrl +R) in QTP

 

4.     Click on “Add Objects to Local”, Observe that Hand Icon is displayed. Show the Hand Icon on “Compose Mail” Link and apply “Left Mouse Click” (Please view below screen shot for quick reference for Compose Mail Page)

 

5.     The moment when you apply left click you can see the Pop window as like below on QTP Window i.e.

 

6.     If we observe the above pop window focus is placed on “Link: Inbox(5)”

7.     We are not going to add “Link” object to Object Repostiry so select “Web Table :Compose Mail”

image

After selecting the required object on “Object Selection-Add to Repositry” window, Click on [OK] button.

8.     Its observed that object is added to Object Repository i.e.

image

9.     Now drag and drop the Compose Mail object on QTP.

10.                        Now you might have seen the code on QTP i.e.

image

 

11.                        Change the code using “Childitem” method

image

 

12.                        Now Open GMAIL Application. Click on “Sent Mail” link so that we will come know that it navigates to “Inbox” page after execution of this script i.e.

image

13.                        Open QTP and run the script which we created i.e.

 

image

14.                        Click on “RUN” or “F5” function Key, Observe that it navigated to Inbox Page.

image

15.                        Send a mail to your Email id so that Inbox count will be increased by 1.

image

16.                        Now Open GMAIL Application. Click on “Sent Mail” link so that we will come know that it navigates to “Inbox” page after execution of this script i.e.

17.                        Open QTP and run the script which we created i.e.

 

image

18.                        Click on “RUN” or “F5” function Key, Observe that it navigated to Inbox Page.

 

 

 

 

Clicking on Inbox Link without Using Regular Expression: (Using Descriptive Programming)

Browser("name:=Gmail.*").Page("title:=Gmail.*").WebTable("name:=Compose Mail.*","Index:=1").ChildItem(3,1,"Link",0).Click

 

image

 

Here I am passing Index: =1 because we have two similar objects i.e. WebTable name called “Compose Mail”.

 

asked Jun 5, 2012 by kriru (641 points)   7 10 15
    
thank u for the nice explanation
Hi, This is Shyam
I am using QTP11, and trying to automate gmail.I m trying with supported browser mozillafirefox 3.5.I am successfully able to navigate,login clicking on compose,setting to,subject,body.
But I am not able to click on send button.Can you please help me and give me relevant code for the same. for mozillafirefox

1 Answer

0 votes

Many thanks to our estemmed community adminsitrator Venkat  for this post!

answered Jun 5, 2012 by kriru (641 points)   7 10 15
Thanks for posting the nice stuff,
i had a question, i tried to find the row count of the mails using object spy by click on the one of my inbox mail it showing 3 webtables, i don't now which table i have to select to get the row count of my inbox webtable.

can you please suggest anything.
...