Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Verify images get properly loaded or not(Broken Images) in respective pages
#5
Solved: 11 Years, 3 Months, 4 Weeks ago
Hi All,

Finally this code worked for me. Please have a look and let me know if anyone have any suggestion to make it better.

Code:
SystemUtil.Run "C:\Documents and Settings\nilanjans\Desktop\Count Broken Images\Example\BrokenLink.html"

wait(5)

Browser("Creationtime:=0").Sync
wait(3)
Set oDesc=Description.Create()
oDesc("micclass").Value="Image"
oDesc("html tag").Value="IMG"
Set linkCollection=Browser("title:=.*").Page("title:=.*").ChildObjects(oDesc)
msgbox linkCollection.count
brokenImg=0
For i=0 to linkCollection.Count-1
    nativePropertyVal = linkCollection(i).Object.sourceindex
    msgbox  nativePropertyVal'Use the native property in place of sourceindex
'    If StrComp(nativePropertyVal,"4")=0 Then 'Compare the native property value you want to use
       If linkCollection(i).Object.fileSize<=0 then

           msgbox "Image Broken"
           brokenImg=brokenImg+1
           else
           msgbox "Image loaded properly"
       End if
'    End If
Next

Msgbox "Broken Image Count on Page:" &brokenImg

Thanks,
Nilanjan
Reply


Messages In This Thread
RE: Verify images get properly loaded or not(Broken Images) in respective pages - by nilanjans - 01-17-2013, 10:51 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Pages and Frames adding _1, _2, _3... zunebuggy 1 1,668 05-30-2017, 12:17 AM
Last Post: Vichu M J
  [UFT] [WPF] Verify if the cell contains an image robertosalemi 0 1,901 10-25-2016, 06:57 PM
Last Post: robertosalemi
  Need to verify the drop down values based on condition santhoshmscsoftware 1 2,912 05-04-2016, 11:28 PM
Last Post: supputuri
  verify that parent properties match object currently displayed in your application. sona 0 3,137 02-21-2016, 12:00 PM
Last Post: sona
Exclamation How to verify whether pdf is completely loaded or not in webpage nmakkena 1 2,685 08-27-2014, 04:09 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 3 Guest(s)