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

Suppose in a page we are supposed to have 5 images.(Expected)
How you can make sure that on run time all the images been loaded properly in proper location.(We don't have any broken images on the page)

My view is that you can put bitmap checkpoint to those images so on run time it goes for bit by bit comparison and comes up with appropriate result.
But if there are more number of images (30+) then we need to set bitmap checkpoint for each of the images .
So what can be the way in such case?

Please share you view regarding this situation. Handling the situation using descriptive programming will be helpful.
Reply
#2
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi All

Just adding some more information regarding the situation.

I have created a HTML page that having two images, that i am fetching from my hard drive.
But among these two one of the images does not exist in the drive at all. so when the page gets loaded it shows that it loaded a broken image.
Now Object spying it shows the all the identification properties are same for both the images.But one is loaded and other is not.
How to write script for this situation.
Please help me out.

Thanks in advance.
Nilanjan
Reply
#3
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi ,

Try to identify the 'X' mark on the broken image , this can solve your problem , then do a negative testing to find the 'x' mark on the page. If found then there is a broken image , if not then everthing is fine..

Thanks,
Harish
Reply
#4
Solved: 11 Years, 4 Months, 3 Weeks ago
Hi Harish,

Yes, your above concept sounds logical.
When images does to get loaded on run time(i.e Broken Images) those come up with "X" mark on page.

But for each and every image how to identify that 'X" mark, because you don't know they will be broken or not on run time. And for Identifying "X" mark which process should we follow. I can think of "Bitmap checkpoints" on "X" marks , but that also have to be given at design time it self.
It will be really helpful if you come up with any scenario and code for that.

Thanks,
Nilanjan.
Reply
#5
Solved: 11 Years, 4 Months, 3 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


Possibly Related Threads…
Thread Author Replies Views Last Post
  Pages and Frames adding _1, _2, _3... zunebuggy 1 1,698 05-30-2017, 12:17 AM
Last Post: Vichu M J
  [UFT] [WPF] Verify if the cell contains an image robertosalemi 0 1,917 10-25-2016, 06:57 PM
Last Post: robertosalemi
  Need to verify the drop down values based on condition santhoshmscsoftware 1 2,968 05-04-2016, 11:28 PM
Last Post: supputuri
  verify that parent properties match object currently displayed in your application. sona 0 3,146 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,746 08-27-2014, 04:09 PM
Last Post: vinod123

Forum Jump:


Users browsing this thread: 1 Guest(s)