Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
QTP Script for opening gmail and enter details
#3
Solved: 10 Years, 9 Months, 2 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


Messages In This Thread
RE: QTP Script for opening gmail and enter details - by upadhyay40 - 11-23-2009, 01:59 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  GMAIL Object Identification sidqtp 2 3,417 11-08-2014, 10:12 AM
Last Post: vinod123
  Facing issue with Java Table to press Enter Key from Keyboard Nasir Ahmed 0 4,394 05-23-2014, 08:05 PM
Last Post: Nasir Ahmed
Rolleyes Urgent help with Gmail Sending mail feature nidhitaneja 2 2,769 03-05-2014, 09:39 PM
Last Post: nidhitaneja
Question QTP Script for enter data to DB geethu105 2 3,161 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,707 12-02-2013, 01:35 PM
Last Post: akhandesh

Forum Jump:


Users browsing this thread: 1 Guest(s)