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

Explain about filter expression?

782


What is byref and byval parameters in vbscript?

822


can anyone tell me the procedure of interview held in applabs

1963


Which function allows you to instantiate an object given its programmatic identifier or progid?

798


How will you convert a given number to long in vbscript?

673


Explain about constants in vb script?

786


Explain about adodb.stream class?

820


Which operator can be used to do an xor operation in vbscript?

974


How to find the font in qtp. Scenario:After entering the username and passwd you will be navigate into the "welcome:Username" page.Now I want to extarct font for this message.

1938


Which operator is used to concatenate the 2 values in the vbscript language?

788


Which operator is used for fetching the modulus of the 2 numbers in the vbscript language?

759


What is the use of the date function in the vbscript language?

781


Explain the adodb.stream class?

751


If we take 2 strings as “good” and “bad” then what will ‘+’ and ‘&’ operators return?

747


Explain about the asc function?

820