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

Answer Posted / 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       View All Answers


Please Help Members By Posting Answers For Below Questions

How will you get the largest subscript of an array in vbscript?

613


There are 5 web pages.write a script to click the button on 4th web page.

2942


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

1826


What is dictionary object in vbscript? Explain?

628


Explain the filter expression?

634






Mention characteristics of sub procedures?

582


How to delete a cookie using vbscript?

555


What is the use of option explicit statement?

585


What are the naming conventions while declaring a variable in the vbscript language?

621


Which loop is used in case of arrays in the vbscript language?

524


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.

1796


Explain about constants in vb script?

577


where can i learn VB scripint ?

1602


1.I want to establish connection with excel and also want to fetch the data using SQL queries. 2.the code should be written in such a way that in future if I want to migrate from excel to MS excess database , then there should be minimal changes.

1523


Explain the functionality of vbscript?

540