write script to open Gmail.com, and to write script for
entering username and password and show whether the result
as pass or fail

Answer Posted / srinivasareddy

'---------------------------------------------opening gmail
login page------------------------------------------------
systemutil.Run "iexplore.exe","www.gmail.com",,,3
wait(20)
If Browser("name:=Gmail: Email from
Google").Page("title:=Gmail: Email from
Google").WebEdit("name:=Email","html id:=Email").exist Then
Reporter.ReportEvent micPass,"Login page","Gmail Login
Page Succesfully Opened"
Browser("name:=Gmail: Email from
Google").Page("title:=Gmail: Email from
Google").WebEdit("name:=Email","html id:=Email").set
"balagisrinu.reddy"
Browser("name:=Gmail: Email from
Google").Page("title:=Gmail: Email from
Google").WebEdit("name:=Passwd","html id:=Passwd").set
"00000000"
Browser("name:=Gmail: Email from
Google").Page("title:=Gmail: Email from
Google").WebButton("name:=Sign in","html id:=signIn").Submit
else
Reporter.ReportEvent micFail,"Login page","Gmail Login Page
Not Opened Succesfully "
ExitTestIteration
End If
'--------------------------------------------------------------------------------------------------------------------------------------------
'------------------------------------------------validating
the my mail id opened--------------------------------------
'Browser("name:=Gmail - Inbox").Page("title:=Gmail -
Inbox").Link("text:=Compose Mail","name:=Compose
Mail").highlight
wait(20)
If Browser("name:=Gmail - Inbox").Page("title:=Gmail -
Inbox").Link("text:=Compose Mail","name:=Compose
Mail").exist Then
Reporter.ReportEvent micPass,"Sign in","login is successfully"
else
Reporter.ReportEvent micPass,"Sign in","login is Not
successfull"
ExitTestIteration
End If
'-----------------------------------------------------------------------------------------------------------------------------------------------------

Is This Answer Correct ?    8 Yes 1 No



Post New Answer       View All Answers


Please Help Members By Posting Answers For Below Questions

I need to get some data from data base and store this (retrieved) data in a excel sheet using VB script in QTP9.0 I have created connection for data base I have created as excels sheet by using Set XL=CreateObject("Excel.Application") XLworksheet.cells(1,1).value= rs.fields.item("<>") I have taken a for loop and changed the cells values (1 as i and another 1 as j) But still I am not able to get Plz kindly tell me know this . It is very urgent

1769


Mention how to create a cookie using vbscript?

526


Explain about scrrun.dll in vbscript?

646


Sub link() Dim k As Integer Dim rand As Integer Dim URL As String Dim foldernum As Integer Dim folderstring As String Dim filenum As Integer Dim filestring As String k = 1 'for AC Numbers For i = 11 To 40 foldernum = 0 foldernum = 1000 + i folderstring = CStr(foldernum) folderstring = Mid(folderstring, 2, 3) folder = "ac" & folderstring 'folderstring = Sheets(2).Cells(i, 1) ' for Number of Random files For j = 1 To 10 rand = Int(Rnd * (200 - 1) + 1) filenum = 0 filenum = 1000 + rand filestring = CStr(filenum) filestring = Mid(filestring, 2, 3) 'URL = "http://ceobihar.nic.in/PSCDROM/ac" & folderstring & "/i" & folderstring & "0" & filestring & ".pdf" URL = "http://www.elections.tn.gov.in/pdfs/dt1/" & folder & "/" & folder & filestring & ".pdf" ' URL =http://www.wb.nic.in/wbeco/EROLLS/PDF/English/A001/a0010105 .pdf Cells(k, 1) = folderstring Cells(k, 2) = folder Cells(k, 3) = filestring Cells(k, 3) = URL k = k + 1 Next j Next i End Sub plz define it

2235


Why is the use of exit do or exit for statements within loops discouraged?

565






Hi, Can anyone please send me vb script examples to practice vb and also material to learn vb scripting in QTP? my email id : hareen_11@yahoo.com

1812


What purpose does ‘on error resume next’ serves?

545


after medical test,when will be the police verification

1711


How can you fetch the value of a cookie?

548


What is the use of the recordset object and which statement is used to create such an object?

527


How to access array data?

542


What are class events?

581


How to pass argument by reference to a function in vbscript?

536


How to Import data from a file (file is on the desktop) to the data table

1556


Explain some uses of vb script?

551