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

Is VBscript case-sensitive?

3 Answers  


How to delete a cookie using vbscript?

0 Answers  


hi all, i had a question, that how to find out hiding a coloumn in a table i had a table having the following column names NAME DESCRIPTION CREATED TIME CREATED USER if i right clicked on a NAME column it will displays a menu having the same column names in a list like NAME DESCRIPTION CREATED TIME CREATED USER with check boxes.if i unched any check box, that column name should not be appear in the main table column names could anyone please solve this problem?

0 Answers   Livetek,


What is the use of the recordset object and which statement is used to create such an object?

0 Answers  


What are the special sub-types in vbscript?

0 Answers  






Give examples where vb script can directly run on users system with windows as os?

1 Answers  


How to write Descriptive programming in .VBS file i wrote this code but it is giving error.. Dim qtApp set qtApp=createobject("QuickTest.Application") qtApp.Launch qtApp.Visible=True Set objIE = CreateObject("InternetExplorer.Application") objIE.visible = True objIE.Navigate "www.gmail.com" browser("title:=gmail").title("title:=gmail")

2 Answers  


In our application qtp unable to indentify the menu items,we tried number of times to add objetcs into object repository but fail. through normal recording mode only objects going to add into repository but while running same recording script qtp showing a error like " unable to indentify the object". in repository there is no any properties and pro values for that object and also i tried with virtual object config also unable to find the object in application and in repository. Then what i have to do to identify menu objects????? can anybody hell me pls..............

2 Answers   Blue Star,


Have any one know about Test Complete 6, please let me know. If any one have good material regarding Test Complete 6, Please send to my mail id: cns.praveen@gmail.com

1 Answers  


Hello friends..... Can any give the methods for Ms-Access, and Mozilla firefox in Automation Object Model in QTP. Please give me currect answers... if you do not understand my question please don't give answers. Thanking you.

0 Answers  


write a vbscrpit to swap values

2 Answers   Adani,


1. How do declare public variable in vb scripts?

0 Answers  


Categories