07-14-2009, 04:50 PM
Use the below script to check that content of page should not be "Page cannot be displayed
Code:
Set obj_LinkDesc = Description.Create
obj_LinkDesc("html tag").value = "A"
Set AllLinks = Browser("name:=Google").Page("title:=Google").ChildObjects(obj_LinkDesc)
msgbox AllLinks.Count
For i = 0 To AllLinks.Count
Set obj_LinkDesc = Description.Create
obj_LinkDesc("html tag").value = "A"
Set AllLinks = Browser("name:=Google").Page("title:=Google").ChildObjects(obj_LinkDesc)
AllLinks(i).Click
Wait 2
If Browser("name:=Cannot find server").Page("title:=Cannot find server").Exist Then
Msgbox ("Problem")
Else
Msgbox ("No Problem")
End If
Browser("opentitle:=Google").Back