Verify Broken Links using VBscript (without checkpoints)

One of my friends just wanted to check for the broken links (both textlinks and image links) on the page with VB script and not the checkpoints.
So the answer for that was the following code
---------------------------------------------------------
set
obj=Browser("name:=Blackboard.*").Page("title:=Blackboard.*").Frame("name:=main.*").object.all.tags("IMG")

msgbox obj.length

For each element in obj
s1=element.nameProp

If Browser().Page().Frame().Image("file
name:="&s1,"index:=0").exist(0) then
If Browser().Page().Frame().Image("file
name:="&s1,"index:=0").Object.complete="True" then

msgbox "pass"

else
msgbox "fail"

end if
end if

Next
---------------------------------------------------------

Code provided by my friend Shiva

No comments: