12-09-2008, 11:39 AM
Hi All,
Can anyone answer this question please?
I am trying to capture the Privacy policy of Google and store in a Text file.
I have written the following code.
All the lines are executed successfully till it reaches CreateTextFile line.
Please let me know what did I miss in the above code?
Earliest reply is highly appreciated!
Thanks,
Kishore
Can anyone answer this question please?
I am trying to capture the Privacy policy of Google and store in a Text file.
I have written the following code.
Code:
If browser("Google").Page("Google").Image("Google").Exist Then
reporter.ReportEvent micDone, "google page", "google page is found"
else
reporter.ReportEvent micDone, "google page", "google page not found. Exiting"
ExitAction()
End If
If browser("Google").Page("Google").Link("Privacy").Exist Then
reporter.ReportEvent micDone, "Google privacy", "google privacy link found"
else
reporter.ReportEvent micDone, "google privacy", "google privacy link not found.Exiting"
ExitAction()
End If
If browser("Google").Page("Google").Link("Privacy").Exist Then
browser("Google").Page("Google").Link("Privacy").Click()
End If
If browser("Google").Page("Privacy Center").Link("Privacy Policy").Exist Then
reporter.ReportEvent micDone, "Privacy center", "Privacy center page found"
else
reporter.ReportEvent micDone, "Privacy center", "privacy center page not found. Exiting"
ExitAction()
End If
If browser("Google").Page("Privacy Center").Link("Privacy Policy").Exist Then
browser("Google").Page("Privacy Center").Link("Privacy Policy").Click()
End If
If browser("Google").Page("Privacy Policy – Google").WebButton("Search").Exist Then
reporter.ReportEvent micDone,"Privacy policy", "you are in the right page"
else
reporter.ReportEvent micDone,"Privacy policy", "You are in the wrong page"
End If
Dim str
If browser("Google").Page("Privacy Policy – Google").WebButton("Search").Exist Then
str=browser("Google").Page("Privacy Policy – Google").GetROProperty("innertext")
End If
Dim fso, File1, File2
Set objFSO=CreateObject("Scripting.FileSystemObject")
objFile1=FSO.CreateTextFile("C:\testfile.txt", true)
Const ForWriting=2
Set objFSO=CreateObject("Scripting.FileSystemObject")
objFile2=FSO.OpenTextFile("C:\testfile.txt", ForWriting, True)
objFile1.write str
All the lines are executed successfully till it reaches CreateTextFile line.
Please let me know what did I miss in the above code?
Earliest reply is highly appreciated!
Thanks,
Kishore