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

I have an excel sheet with multiple ID's in a column. Now i need fetch those ID's in an application and check whether if it already exist in the DB. If not then i have to go with the process of inserting them in the DB. If it exists then i need to skip that ID and move to the next ID and check the same and proceed. How can i do that with for loop and if condition?

0 Answers  


How strcomp function works?

0 Answers  


where can i learn VB scripint ?

0 Answers   Satyam,


how to genarate a random numbers in vb?

2 Answers  


write a vb script to display 3*3 matrix

1 Answers  


Mention when to use function procedures and what are its characteristics?

0 Answers  


I need to get some data from data base and store this (retrieved) data in a excel sheet using VB script in QTP9.0 I have created connection for data base I have created as excels sheet by using Set XL=CreateObject("Excel.Application") XLworksheet.cells(1,1).value= rs.fields.item("<<The data retrieved from data base >>") I have taken a for loop and changed the cells values (1 as i and another 1 as j) But still I am not able to get Plz kindly tell me know this . It is very urgent

0 Answers  


how to check whether link is disabled in QTP??

0 Answers  


write a program to display the system specifications of client system with the help of vb script.

1 Answers  


How to copy from one script to another script in qtp

4 Answers  


How are values assigned to the variables in the vbscript language?

0 Answers  


give me any information abou vb script books learn quckly

0 Answers  


Categories