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
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
How to write VB script for login module?
regular expression that will recognize a browser as long as its name property starts with mybrowser
what is the object hyrarchy in QTP for a web based application
What is the difference between vbscript and vba?
Explain about .wsf files?
What are the valid scopes of a variable in vbscript?
What are the different types of loops available in the vbscript language?
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.
How to open browser in vb script?
How to throw an error in vbscript?
What are subprocedures in vbscript?
how to automatically update the sql server2005 database records when insert in vb6?
How do i automate a website www.flyashx.com without having any test cases witin a week time.
How will you convert a string to upper case string using vbscript?