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

create a form to accept username and password validate the username and password with using message box, display the corresponding user message

0 Answers   CSC,


When inserting strings into a SQL table in ASP what is the risk and how can you prevent it?

1 Answers  


Write a code to print numbers from 5 to 0?

0 Answers  


Hi Friends my Question is very simple,in Manual testing when we click on a hyper link it directs us to the relavent page or it re-directs us to the current page,so there we can easily write testcase but same thing if we do in automation script using QTP & need to generate report using Reporter.report event how we will do it?thanks in advance...

0 Answers  


Here in my automation tool, i am retreiving some values and i need to store this values in the excel. How can i achieve this?. We are using VBA as scripting language. please let me know if you require any further inputs.

1 Answers  






explain with example primitive data types of vb script.

1 Answers  


Mention what is the use of option explicit in vbscript?

0 Answers  


Explain the scope of the variables using dim, public, and private keywords respectively.

0 Answers  


write a vb script to create a folder?

3 Answers  


How will you trim the spaces on the left of a string using vbscript?

1 Answers  


Can any one provide code for Mid(string,start[,length]). I have been asked to write code for Mid(). i.e We need to define our own function say MyMid() which should behave same like built-in Mid function

0 Answers   Microsoft,


what does create object actually do when you call it in vbscript?

1 Answers   Cap Gemini,


Categories