how to write vb script code for login gmail page by using
notepad and how to run script in notepad



how to write vb script code for login gmail page by using notepad and how to run script in notepad..

Answer / bittu

Write the below code in atext file and save it with .vbs
extension and run it. U will login into gmail automatically.
Provide the credentials in the line 10 & 11.

---------------------------------
WScript.Quit Main

Function Main
Set IE =
WScript.CreateObject("InternetExplorer.Application", "IE_")
IE.Visible = True
IE.Navigate "http://www.gmail.com"
Wait IE
With IE.Document
.getElementByID("Email").value = "abcd"
.getElementByID("Passwd").value = "xyzp"
.getElementByID("gaia_loginform").submit
End With
End Function

Sub Wait(IE)
Do
WScript.Sleep 500
Loop While IE.ReadyState < 4 And IE.Busy
Do
WScript.Sleep 500
Loop While IE.ReadyState < 4 And IE.Busy
End Sub

Sub IE_OnQuit
On Error Resume Next
WScript.StdErr.WriteLine "IE closed before script finished."
WScript.Quit
End Sub

Is This Answer Correct ?    0 Yes 10 No

Post New Answer

More VB Script Interview Questions

about vb scripting programs this type of all question& answers

0 Answers  


write a vb script to add two 2*2 matrix

2 Answers  


Mention what are the rules to name variable in vbscript?

0 Answers  


hai all.iam chandu..please let me know how to test a link in QTP when it is changing at run time..and what property we should take while we r using descriptive programming for a link..

6 Answers  


What are the rules to name variable in vbscript?

0 Answers  






what is the code in QTP to take screen shot? Please send me any one to my mail id. my mailid is manu.sanepalli@gmail.com

4 Answers   TCS,


What are the 2 ways in which a variable can be declared in the vbscript language?

0 Answers  


What are the 2 ways to pass a value to the function?

0 Answers  


What is the difference between VBScript and JavaScript?

0 Answers  


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

1 Answers   IBM,


Mention what is vbscript?

0 Answers  


How can we return a value from User Defined Function ? For Eg. we have 2 functions. In Fun1 i am getting 2 values (a,b) and i am addding those 2 and storing in to another var (c). Now i want to pass that var(c) to another function (fun2). What will be the script?

6 Answers   Nous,


Categories