[Webtest] How to located the same name of text fileds in table
Zhou Xue
webtest@lists.canoo.com
Tue, 11 May 2004 09:10:29 +0800
This is a multi-part message in MIME format.
------_=_NextPart_001_01C436F4.BFE855F2
Content-Type: multipart/alternative;
boundary="----_=_NextPart_002_01C436F4.BFE855F2"
------_=_NextPart_002_01C436F4.BFE855F2
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
> Hi,
There is a problem need your help:
> When I do test with <Setinputfield>,I need to input many values in =
some text fields,For these text fields in different lines,but there is a =
same name for these fields in html.
> When I prepare test script, I have to give multi different values to =
same name in script.
> But, i get the result is there is the last value in the first text =
field, and others is null.
> Could you help me to solve the problem ?
> thanks.
> My expect result page as:
> > > <<Picture (Metafile)>>=20
> But get the result page such as:
> > > <<Picture (Metafile)>>=20
>=20
> Bellow is my source and my test script, please as reference=20
>=20
> for(int i =3D 0; i < tmpPocCd.length; ++i) { %>
> <tr CLASS=3D"HL">
> <td > <input type=3D"checkbox" name=3D"selected" value=3D"<%=3D i =
%>"></td>
> <td><%=3D i+1 %> </td>
> <td>
> =20
> <input type=3D"text" name=3D"pocCd" size=3D"5" maxlength=3D"5" =
Value=3D"<%=3D tmpPocCd[i]=3D=3Dnull ? : tmpPocCd[i] %>">
> </td>
> My test script:
> <setinputfield
> stepid=3D"set Port Code in Select Update Sailing Schedule Detail =
page"
> name=3D"pocCd2"
> value=3D"CNDLC"/>
> <setinputfield
> stepid=3D"set Port Code in Select Update Sailing Schedule Detail =
page"
> name=3D"pocCd22"
> value=3D"USSEA"/>
> <setinputfield
> stepid=3D"set Port Code in Select Update Sailing Schedule Detail =
page"
> name=3D"pocCd23"
> value=3D"SGSIN"/>
>=20
> Thanks a lot.
>=20
>=20
------_=_NextPart_002_01C436F4.BFE855F2
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN">
<HTML>
<HEAD>
<META HTTP-EQUIV=3D"Content-Type" CONTENT=3D"text/html; =
charset=3Diso-8859-1">
<META NAME=3D"Generator" CONTENT=3D"MS Exchange Server version =
6.0.6556.0">
<TITLE>How to located the same name of text fileds in table</TITLE>
</HEAD>
<BODY>
<!-- Converted from text/rtf format -->
<BR>
<UL>
<P ALIGN=3DJUSTIFY><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" =
FACE=3D"Times New Roman">Hi,</FONT></SPAN></P>
<P ALIGN=3DJUSTIFY><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">T</FONT><FONT COLOR=3D"#000080" FACE=3D"Times New =
Roman">here is a</FONT><FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"Arial"> =
problem</FONT> <FONT COLOR=3D"#000080" FACE=3D"Times New Roman">need =
your help:</FONT></SPAN></P>
<P><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">When=A0I do test</FONT> <FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">with</FONT> <FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial"><Setinputfield>,I need to input many values =
in</FONT><FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"Arial"> some text =
fields</FONT><FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"Arial">,For these =
text fields in different lines,</FONT><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">but</FONT> <FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">there</FONT> <FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">is a</FONT><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial"> same name</FONT><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial"> for these fields</FONT><FONT COLOR=3D"#0000FF" SIZE=3D2 =
FACE=3D"Arial"></FONT> <FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">in html</FONT><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">.</FONT></SPAN></P>
<P><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">When I prepare test script, I have to give multi</FONT> =
<FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"Arial">different</FONT> <FONT =
COLOR=3D"#000080" SIZE=3D2 FACE=3D"Arial">value</FONT><FONT =
COLOR=3D"#000080" SIZE=3D2 FACE=3D"Arial">s</FONT><FONT =
COLOR=3D"#000080" SIZE=3D2 FACE=3D"Arial"></FONT> <FONT =
COLOR=3D"#000080" SIZE=3D2 FACE=3D"Arial">to</FONT><FONT =
COLOR=3D"#000080" SIZE=3D2 FACE=3D"Arial"> same name in =
script.</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">But, i get the result is there is the last value in =
the first text field, and other</FONT><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">s</FONT><FONT COLOR=3D"#000080" SIZE=3D2 FACE=3D"Arial"> =
is null.</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">Could you help me to solve the problem ?</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">thanks.</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">My expect result page as:</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial"><FONT FACE=3D"SimSun" SIZE=3D2 COLOR=3D"#000000">
<IMG SRC=3D"No%20AttachName" alt=3D"Picture =
(Metafile)"></FONT></FONT></SPAN>
<BR><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">But get the result page such as:</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial"><FONT FACE=3D"SimSun" SIZE=3D2 COLOR=3D"#000000">
<IMG SRC=3D"No%20AttachName-1" alt=3D"Picture =
(Metafile)"></FONT></FONT></SPAN>
</P>
<P><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">Bellow is my source and my test script, please as =
reference </FONT></SPAN>
</P>
<P><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">for(int i =3D 0; i < tmpPocCd.length; ++i) { %><BR>
<tr CLASS=3D"HL"><BR>
<td=A0 > <input type=3D"checkbox" =
name=3D"selected" value=3D"<%=3D i =
%>"></td><BR>
<td><%=3D i+1 %> </td><BR>
<td></FONT></SPAN>
<BR><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">=A0</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial"><input type=3D"text" =
name=3D"pocCd" size=3D"5" maxlength=3D"5" =
Value=3D"<%=3D tmpPocCd[i]=3D=3Dnull ? : tmpPocCd[i] =
%>"></FONT></SPAN>
<BR><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial"> </td><BR>
My test script:</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial"><setinputfield</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"> =
=
=
<FONT COLOR=3D"#000080" =
SIZE=3D2 FACE=3D"Arial"> stepid=3D"set Port Code in Select Update =
Sailing Schedule Detail page"</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"> =
=
=
<FONT COLOR=3D"#000080" =
SIZE=3D2 FACE=3D"Arial"> name=3D"pocCd2"</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"> =
=
=
<FONT COLOR=3D"#000080" =
SIZE=3D2 FACE=3D"Arial"> value=3D"CNDLC"/></FONT></SPAN>
<BR><SPAN LANG=3D"en-us"> =
=
<FONT COLOR=3D"#000080" =
SIZE=3D2 FACE=3D"Arial"> <setinputfield</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"> =
=
=
<FONT COLOR=3D"#000080" =
SIZE=3D2 FACE=3D"Arial"> stepid=3D"set Port Code in Select Update =
Sailing Schedule Detail page"</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"> =
=
=
<FONT COLOR=3D"#000080" =
SIZE=3D2 FACE=3D"Arial"> name=3D"pocCd22"</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"> =
=
=
<FONT COLOR=3D"#000080" =
SIZE=3D2 FACE=3D"Arial"> value=3D"USSEA"/></FONT></SPAN>
<BR><SPAN LANG=3D"en-us"> =
=
<FONT COLOR=3D"#000080" =
SIZE=3D2 FACE=3D"Arial"> <setinputfield</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"> =
=
=
<FONT COLOR=3D"#000080" =
SIZE=3D2 FACE=3D"Arial"> stepid=3D"set Port Code in Select Update =
Sailing Schedule Detail page"</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"> =
=
=
<FONT COLOR=3D"#000080" =
SIZE=3D2 FACE=3D"Arial"> name=3D"pocCd23"</FONT></SPAN>
<BR><SPAN LANG=3D"en-us"> =
=
=
<FONT COLOR=3D"#000080" =
SIZE=3D2 FACE=3D"Arial"> value=3D"SGSIN"/></FONT></SPAN>
</P>
<P ALIGN=3DJUSTIFY><SPAN LANG=3D"en-us"><FONT COLOR=3D"#000080" SIZE=3D2 =
FACE=3D"Arial">=A0Thanks a lot.</FONT></SPAN></P>
<BR>
</UL>
</BODY>
</HTML>
------_=_NextPart_002_01C436F4.BFE855F2--
------_=_NextPart_001_01C436F4.BFE855F2
Content-Type: image/bmp;
name="ole0.bmp"
Content-Transfer-Encoding: base64
Content-Description: Picture (Metafile)
Qk0+AAAAAAAAADoAAAAoAAAAAQAAAAEAAAABAAEAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAA
AAAAAAA=
------_=_NextPart_001_01C436F4.BFE855F2
Content-Type: image/bmp;
name="ole1.bmp"
Content-Transfer-Encoding: base64
Content-Description: Picture (Metafile)
Qk0+AAAAAAAAADoAAAAoAAAAAQAAAAEAAAABAAEAAAAAAAAAAAAAAAAAAAAAAAEAAAAAAAAAAAAA
AAAAAAA=
------_=_NextPart_001_01C436F4.BFE855F2--