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 am having some basic knowledge in c and VB 6.0. i qtp i want to know how to write the codings. by recording it is generating lot of codings. for example i want to test the text box. senerio is text box should not accept alphabets if it accept alphabets we should return fail status if it get number we should return pass status. how to write coding in vb script please help me

1797


How to write VB script for login module?

2676


regular expression that will recognize a browser as long as its name property starts with mybrowser

1761


what is the object hyrarchy in QTP for a web based application

1885


What is the difference between vbscript and vba?

602






Explain about .wsf files?

621


What are the valid scopes of a variable in vbscript?

608


What are the different types of loops available in the vbscript language?

532


I want to run QTP script on Linux server is it possible to do this by connecting Windows to Linux through VPN/Terminal Server and just run the script on Linux server.

1791


How to open browser in vb script?

582


How to throw an error in vbscript?

602


What are subprocedures in vbscript?

661


how to automatically update the sql server2005 database records when insert in vb6?

1485


How do i automate a website www.flyashx.com without having any test cases witin a week time.

1457


How will you convert a string to upper case string using vbscript?

551