[Webtest] Verify image images-names, -sizes, alt-texts
Denis N. Antonioli
webtest@lists.canoo.com
Fri, 7 Apr 2006 17:32:43 +0200
--Apple-Mail-1-760522808
Content-Transfer-Encoding: 7bit
Content-Type: text/plain;
charset=US-ASCII;
delsp=yes;
format=flowed
Hi
On 7 avr. 06, at 10:36, Marius Oancea wrote:
> Is there any posibility to acomplish that ? (verify images-names,
> -sizes, alt-texts, ...)
you can easily verify the attributes of the html element <img /> with
an xpath.
For example, to verify the alternate text of the third image on the
page:
<verifyXPath xpath="//img[3]/@alt" text="alternate text" />
Xpath is your friend ;-)
> How about **verification of the URL that has been invoked**?
Do you mean the URL of the image? Webtest doesn't invoke the image
automatically.
Could the step verifyLinkedContent help you?
It lets you make sure that the url doesn't 404, and optionally that
the result has a correct mime-type.
Hope that helps.
dna
--
If you do not feel safe on the streets at night, what do you think it
is like on the Information Superhighway?
- A. Farrel, RFC 4041
--Apple-Mail-1-760522808
Content-Transfer-Encoding: quoted-printable
Content-Type: text/html;
charset=ISO-8859-1
<HTML><BODY style=3D"word-wrap: break-word; -khtml-nbsp-mode: space; =
-khtml-line-break: after-white-space; ">Hi<DIV><BR><DIV><DIV>On 7 avr. =
06, at 10:36, Marius Oancea wrote:</DIV><BR =
class=3D"Apple-interchange-newline"><BLOCKQUOTE type=3D"cite"><DIV =
style=3D"margin-top: 0px; margin-right: 0px; margin-bottom: 0px; =
margin-left: 0px; ">Is there any posibility to acomplish that ? (verify =
images-names,</DIV><DIV style=3D"margin-top: 0px; margin-right: 0px; =
margin-bottom: 0px; margin-left: 0px; ">-sizes, alt-texts, =
...)</DIV></BLOCKQUOTE><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>you can easily verify the =
attributes of the html element <img /> with an =
xpath.</DIV><DIV>For example, to verify the alternate text of the third =
image on the page:</DIV><DIV><SPAN class=3D"Apple-tab-span" =
style=3D"white-space:pre"> </SPAN><verifyXPath =
xpath=3D"//img[3]/@alt" text=3D"alternate text" /></DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV>Xpath is your friend =
;-)</DIV><BR><BLOCKQUOTE type=3D"cite"><DIV style=3D"margin-top: 0px; =
margin-right: 0px; margin-bottom: 0px; margin-left: 0px; ">How about =
**verification of the URL that has been =
invoked**?</DIV></BLOCKQUOTE></DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV>Do you mean the URL of the =
image?=A0Webtest doesn't invoke the image automatically.</DIV><DIV>Could =
the step verifyLinkedContent help you?</DIV><DIV>It lets you make sure =
that the url doesn't 404, and=A0optionally that the result has a correct =
mime-type.</DIV><DIV><BR class=3D"khtml-block-placeholder"></DIV><DIV>Hope=
that helps.</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV><SPAN =
class=3D"Apple-tab-span" style=3D"white-space:pre"> =
</SPAN>dna</DIV><DIV><BR =
class=3D"khtml-block-placeholder"></DIV><DIV><BR><DIV> <P style=3D"margin:=
0.0px 0.0px 0.0px 0.0px"><FONT face=3D"Courier" size=3D"4" style=3D"font:=
14.0px Courier">--<SPAN =
class=3D"Apple-converted-space">=A0</SPAN></FONT></P> <P style=3D"margin: =
0.0px 0.0px 0.0px 0.0px"><FONT face=3D"Courier" size=3D"4" style=3D"font: =
14.0px Courier">If you do not feel safe on the streets at night, what do =
you think it is like on the Information Superhighway?</FONT></P> <P =
style=3D"margin: 0.0px 0.0px 0.0px 0.0px"><FONT face=3D"Courier" =
size=3D"4" style=3D"font: 14.0px Courier"><SPAN =
class=3D"Apple-converted-space">=A0 </SPAN>- A. Farrel, RFC =
4041</FONT></P> </DIV><BR></DIV></BODY></HTML>=
--Apple-Mail-1-760522808--