I will capture the image manually and scriptify using Sikuli. To find
the captured image in the web page. Once it finds the image I need to
collect the information of the image like,
Co-ordinates of the image, height and width, color and pixel rate of
the image.
Images only have coordinates WHEN RENDERED BY a browser... And those
coordinates will change if the browser changes size, or font size, etc.
Height and Width may be whatever the image file contained, OR
whatever was defined in an IMG tag if the browser has the ability to
scale images during rendering. "color and pixel rate" don't make any
sense... GIF format files use a look-up table of 256 colors, and the
"pixels" consist of 8-bit index values into that look-up table.
Normally image /references/ will be found by parsing the HTML for
<IMG ...> tags, then finding the SRC attribute and extracting the URL of
the image file... Retrieving the image file is a separate step from
retrieving the main HTML... This presumes you don't want to also find
images tiled as a background, as those are specified in different tags.
If I want to search a particular text in a webpage. I need to find the
font name, type, color and size of the text.
Again dependent upon the browser... I can set my browser to ignore
any font specifications in the HTML and use just a font I choose... Or
let it use which ever is available on my machine from a list it
specifies as metadata.
Note :- We can open the web page in any browser. but I should be able
to capture the attributes of the image/Text displayed.
Does the browser support access from external programs? Then you are
probably looking at accessing the DOM data structure the browser uses
internally.