[Webtest] How to click an image link?
Nimesh Muley
webtest@lists.canoo.com
Fri, 8 Jul 2005 10:15:48 +0530
This is a multi-part message in MIME format.
------_=_NextPart_001_01C58377.E8E73AE0
Content-Type: text/plain; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
Hi,
=20
We had a similar requirement in one of our projects and following was the s=
olution for the same.
=20
Use the <click> step. For the image use XPATH expression.
E.g. in your case it would be=20
<click xpath=3D"//img[@onclick=3DloadPage('/edgedynamics/portal/jsp/analyti=
cs/explorer_chart.jsp');" stepid=3D"View the chart"/>
=20
The onclick attribute is used to locate the image in the example above. Sim=
ilarly I believe you can use other attributes instead of onclick attribute.
=20
Regards,
- Nimesh
-----Original Message-----
From: Tim Miller [mailto:tmiller@edgedynamics.com]
Sent: Friday, July 08, 2005 12:30 AM
To: webtest@lists.canoo.com
Subject: [Webtest] How to click an image link?
Is there a way to click an image so the onclick event is triggered with Web=
Test? Html follows.
=20
=20
<td>
<img name=3D"chart" src=3D"/edgedynamics/portal/images/chart_off.gif"
border=3D"0"
ONMOUSEOVER=3D"showOnButton('chart');"
ONMOUSEOUT=3D"showOffButton('chart');"
ONCLICK=3D"loadPage('/edgedynamics/portal/jsp/analytics/explorer_chart.=
jsp');">
</td>
=20
=20
Thanks,
Tim
=20
=20
(This email message is for the sole use of the intended recipient(s) and ma=
y contain confidential information. Any unauthorized review, use, disclosu=
re or distribution is prohibited. If you are not the intended recipient, p=
lease contact the sender by reply email and destroy all copies of the origi=
nal message.)
=20
MASTEK
"Making a valuable difference"
Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.
In the US, we're called MAJESCO
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Opinions expressed in this e-mail are those of the individual and not that =
of Mastek Limited, unless specifically indicated to that effect. Mastek Lim=
ited does not accept any responsibility or liability for it. This e-mail an=
d attachments (if any) transmitted with it are confidential and/or privileg=
ed and solely for the use of the intended person or entity to which it is a=
ddressed. Any review, re-transmission, dissemination or other use of or tak=
ing of any action in reliance upon this information by persons or entities =
other than the intended recipient is prohibited. This e-mail and its attach=
ments have been scanned for the presence of computer viruses. It is the res=
ponsibility of the recipient to run the virus check on e-mails and attachme=
nts before opening them. If you have received this e-mail in error, kindly =
delete this e-mail from all computers.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
------_=_NextPart_001_01C58377.E8E73AE0
Content-Type: text/html; charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML xmlns=3D"http://www.w3.org/TR/REC-html40" xmlns:o =3D=20
"urn:schemas-microsoft-com:office:office" xmlns:w =3D=20
"urn:schemas-microsoft-com:office:word"><HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; charset=3Diso-8859-=
1">
<META content=3D"MSHTML 6.00.2800.1106" name=3DGENERATOR>
<STYLE>
<!--
/* Style Definitions */
p.MsoNormal, li.MsoNormal, div.MsoNormal
{margin:0in;
margin-bottom:.0001pt;
font-size:12.0pt;
font-family:"Times New Roman";}
a:link, span.MsoHyperlink
{color:blue;
text-decoration:underline;}
a:visited, span.MsoHyperlinkFollowed
{color:purple;
text-decoration:underline;}
pre
{margin:0in;
margin-bottom:.0001pt;
font-size:10.0pt;
font-family:"Courier New";}
span.EmailStyle17
{mso-style-type:personal-compose;
font-family:Arial;
color:windowtext;}
@page Section1
{size:8.5in 11.0in;
margin:1.0in 1.25in 1.0in 1.25in;}
div.Section1
{page:Section1;}
-->
</STYLE>
</HEAD>
<BODY lang=3DEN-US vLink=3Dpurple link=3Dblue>
<DIV><SPAN class=3D500074104-08072005><FONT size=3D2>Hi,</FONT></SPAN></DIV>
<DIV><SPAN class=3D500074104-08072005><FONT size=3D2></FONT></SPAN> </=
DIV>
<DIV><SPAN class=3D500074104-08072005><FONT size=3D2>We had a similar requi=
rement in=20
one of our projects and following was the solution for the=20
same.</FONT></SPAN></DIV>
<DIV><SPAN class=3D500074104-08072005><FONT size=3D2></FONT></SPAN> </=
DIV>
<DIV><SPAN class=3D500074104-08072005><FONT size=3D2>Use the <click> =
step. For=20
the image use XPATH expression.</FONT></SPAN></DIV>
<DIV><SPAN class=3D500074104-08072005><FONT size=3D2>E.g. in your case it w=
ould be=20
</FONT></SPAN></DIV>
<DIV><SPAN class=3D500074104-08072005><FONT size=3D2><click=20
xpath=3D"//img[@onclick=3DloadPage('/edgedynamics/portal/jsp/analytics/expl=
orer_chart.jsp');"=20
stepid=3D"View the chart"/></FONT></SPAN></DIV>
<DIV><SPAN class=3D500074104-08072005><FONT size=3D2></FONT></SPAN> </=
DIV>
<DIV><SPAN class=3D500074104-08072005><FONT size=3D2>The onclick attribute =
is used=20
to locate the image in the example above. Similarly I believe you can use o=
ther=20
attributes instead of onclick attribute.</FONT></SPAN></DIV>
<DIV><SPAN class=3D500074104-08072005><FONT size=3D2></FONT></SPAN> </=
DIV>
<DIV><SPAN class=3D500074104-08072005><FONT size=3D2>Regards,</FONT></SPAN>=
</DIV>
<DIV><SPAN class=3D500074104-08072005><FONT size=3D2>- Nimesh</FONT></SPAN>=
</DIV>
<BLOCKQUOTE dir=3Dltr style=3D"MARGIN-RIGHT: 0px">
<DIV class=3DOutlookMessageHeader dir=3Dltr align=3Dleft><FONT face=3DTah=
oma=20
size=3D2>-----Original Message-----<BR><B>From:</B> Tim Miller=20
[mailto:tmiller@edgedynamics.com]<BR><B>Sent:</B> Friday, July 08, 2005 1=
2:30=20
AM<BR><B>To:</B> webtest@lists.canoo.com<BR><B>Subject:</B> [Webtest] How=
to=20
click an image link?<BR><BR></FONT></DIV>
<DIV class=3DSection1><PRE><FONT face=3D"Courier New" size=3D2><SPAN styl=
e=3D"FONT-SIZE: 10pt">Is there a way to click an image so the onclick event=
is triggered with WebTest? Html follows.<o:p></o:p></SPAN></FONT></P=
RE><PRE><FONT face=3D"Courier New" size=3D2><SPAN style=3D"FONT-SIZE: 10pt"=
><o:p> </o:p></SPAN></FONT></PRE><PRE><FONT face=3D"Courier New" size=
=3D2><SPAN style=3D"FONT-SIZE: 10pt"><o:p> </o:p></SPAN></FONT></PRE><=
PRE><FONT face=3D"Courier New" size=3D2><SPAN style=3D"FONT-SIZE: 10pt"><=
;<SPAN class=3Dstart-tag>td</SPAN>><o:p></o:p></SPAN></FONT></PRE><PRE><=
FONT face=3D"Courier New" size=3D2><SPAN style=3D"FONT-SIZE: 10pt"> &=
lt;<SPAN class=3Dstart-tag>img</SPAN><SPAN class=3Dattribute-name> name</SP=
AN>=3D<SPAN class=3Dattribute-value>"chart" </SPAN><SPAN class=3Dattribute-=
name>src</SPAN>=3D<SPAN class=3Dattribute-value>"/edgedynamics/portal/image=
s/chart_off.gif"<o:p></o:p></SPAN></SPAN></FONT></PRE><PRE><SPAN class=3Dat=
tribute-value><FONT face=3D"Courier New" size=3D2><SPAN style=3D"FONT-SIZE:=
10pt"> </SPAN></FONT></SPAN><SPAN class=3Dattribute-name=
>border</SPAN>=3D<SPAN class=3Dattribute-value>"0"<o:p></o:p></SPAN></PRE><=
PRE><SPAN class=3Dattribute-value><FONT face=3D"Courier New" size=3D2><SPAN=
style=3D"FONT-SIZE: 10pt"> </SPAN></FONT></SPAN><SPAN cl=
ass=3Dattribute-name>ONMOUSEOVER</SPAN>=3D<SPAN class=3Dattribute-value>"sh=
owOnButton('chart');"<o:p></o:p></SPAN></PRE><PRE><SPAN class=3Dattribute-v=
alue><FONT face=3D"Courier New" size=3D2><SPAN style=3D"FONT-SIZE: 10pt">&n=
bsp; </SPAN></FONT></SPAN><SPAN class=3Dattribute-name>ONMOUSEO=
UT</SPAN>=3D<SPAN class=3Dattribute-value>"showOffButton('chart');"<o:p></o=
:p></SPAN></PRE><PRE><SPAN class=3Dattribute-value><FONT face=3D"Courier Ne=
w" size=3D2><SPAN style=3D"FONT-SIZE: 10pt"> </SPAN></FON=
T></SPAN><SPAN class=3Dattribute-name>ONCLICK</SPAN>=3D<SPAN class=3Dattrib=
ute-value>"loadPage('/edgedynamics/portal/jsp/analytics/explorer_chart.jsp'=
);"</SPAN>><o:p></o:p></PRE><PRE><FONT face=3D"Courier New" size=3D2><SP=
AN style=3D"FONT-SIZE: 10pt"></<SPAN class=3Dend-tag>td</SPAN>><o:p><=
/o:p></SPAN></FONT></PRE>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></F=
ONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></F=
ONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Thanks,<o:p></o:p></SPAN></=
FONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial">Tim<o:p></o:p></SPAN></FONT=
></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></F=
ONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D2><SPAN=20
style=3D"FONT-SIZE: 10pt; FONT-FAMILY: Arial"><o:p> </o:p></SPAN></F=
ONT></P>
<P class=3DMsoNormal><FONT face=3DArial size=3D1><SPAN=20
style=3D"FONT-SIZE: 7.5pt; FONT-FAMILY: Arial">(This email message is for=
the=20
sole use of the intended recipient(s) and may contain confidential=20
information. Any unauthorized review, use, disclosure or distributi=
on is=20
prohibited. If you are not the intended recipient, please contact t=
he=20
sender by reply email and destroy all copies of the original=20
message.)</SPAN></FONT><o:p></o:p></P>
<P class=3DMsoNormal><FONT face=3D"Times New Roman" size=3D3><SPAN=20
style=3D"FONT-SIZE: 12pt"><o:p> </o:p></SPAN></FONT></P></DIV></BLOC=
KQUOTE><FONT SIZE=3D3><BR>
<BR>
MASTEK<BR>
"Making a valuable difference"<BR>
Mastek in NASSCOM's 'India Top 20' Software Service Exporters List.<BR>
In the US, we're called MAJESCO<BR>
<BR>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<BR>
Opinions expressed in this e-mail are those of the individual and not that =
of Mastek Limited, unless specifically indicated to that effect. Mastek Lim=
ited does not accept any responsibility or liability for it. This e-mail an=
d attachments (if any) transmitted with it are confidential and/or privileg=
ed and solely for the use of the intended person or entity to which it is a=
ddressed. Any review, re-transmission, dissemination or other use of or tak=
ing of any action in reliance upon this information by persons or entities =
other than the intended recipient is prohibited. This e-mail and its attach=
ments have been scanned for the presence of computer viruses. It is the res=
ponsibility of the recipient to run the virus check on e-mails and attachme=
nts before opening them. If you have received this e-mail in error, kindly =
delete this e-mail from all computers.<BR>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~=
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~<BR>
</FONT>
</BODY></HTML>
------_=_NextPart_001_01C58377.E8E73AE0--