Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP Script for opening gmail and enter details
#1
Solved: 11 Years, 3 Months, 3 Weeks ago
Hi
I am trying to create Descriptive program for open gmai and enter username password.

Could you tell me how can i wirte the descriptive program for login a gmail page.
Reply
#2
Solved: 11 Years, 3 Months, 3 Weeks ago
Ans:
Code:
systemutil.Run "iexplore.exe", "www.gmail.com"
browser("micclass:=browser").page("micclass:=page").WebEdit("name:=Email").Set "abcdd"
browser("micclass:=browser").page("micclass:=page").WebEdit("name:=Passwd").Set "bnghhj"
browser("micclass:=browser").page("micclass:=page").WebButton("name:=Sign in").Click


Note: Make sure that fast close all active browser bcoz i hav given browser("micclass:=browser").so if more than one browser is opened then it can not identify..If u want u can change the property value of browser and can giv browser("name:=Gmail: Email from Google").page("name:=Gmail: Email from Google")..By using dis no need to close other browser.
Reply
#3
Solved: 11 Years, 3 Months, 3 Weeks ago
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
Reply
#4
Solved: 11 Years, 3 Months, 3 Weeks ago
Requesting Everyone to please wrap your code in proper tags, while posting
refer Help

Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  GMAIL Object Identification sidqtp 2 3,609 11-08-2014, 10:12 AM
Last Post: vinod123
  Facing issue with Java Table to press Enter Key from Keyboard Nasir Ahmed 0 4,530 05-23-2014, 08:05 PM
Last Post: Nasir Ahmed
Rolleyes Urgent help with Gmail Sending mail feature nidhitaneja 2 2,912 03-05-2014, 09:39 PM
Last Post: nidhitaneja
Question QTP Script for enter data to DB geethu105 2 3,319 02-24-2014, 06:54 PM
Last Post: guin.anirban
  How To pick up the particular mail in Post Login Gmail page and click on Checkbox akhandesh 0 2,839 12-02-2013, 01:35 PM
Last Post: akhandesh

Forum Jump:


Users browsing this thread: 1 Guest(s)