Sunday, September 14, 2008

Automation of Google

Here I am giving the script to Automate the Google Search Engine
Steps Include in the scripts are:
1-open the internet explorer using invokeapplication method
2-use the waitproperty method to wait to open the explorer
3-using the checkproperty method we check browser is opened or notand store the boolean value into the variable temp
4-if browser is opened then set the url http://www.google.co.in/ into the browser
5-again use the checkproperty for checking that google is opened or not
6-set the "testing jobs" in the edit box
7-click on the google search button
Here is the script:
InvokeApplication("C:\Program Files\Internet Explorer\iexplore.exe")
Browser("Browser").WaitProperty "title", "about:blank", 10000
temp= Browser("Browser").CheckProperty("Visible","True",10000)

If (temp="True") Then
Browser("Browser").WinEdit("Edit").Set("
http://www.google.co.in") Browser("Browser").Navigate("http://www.google.co.in")
Browser("Browser").Page("Google").WebButton("Google Search").WaitProperty "visible", True, 20000
temp= Browser("Browser").Page("Google").WebButton("Google Search").CheckProperty("visible","True",20000)
If (temp= "True") Then
Browser("Browser").Page("Google").WebEdit("q").Set("testing jobs") Browser("Browser").Page("Google").WebButton("Google Search").Click
Browser("Browser").Page("testing jobs - Google").Link("testing").WaitProperty "innertext", testing, 10000
temp=Browser("Browser").Page("testing jobs - Google").Link("testing").CheckProperty("innertext","testing",10000) If (temp="True") Then
else End If else
End If
else
End If

No comments: