Re: Form fields

Dierk König <[email protected]> Fri, 3 Apr 2015 22:53:14 +0200
Newsgroups gmane.comp.web.canoo.webtest
Message-ID <[email protected]>
It could be that you need a setInputField with and xpath attribute - in =
case that your form is somehow generated via JavaScript.
http://webtest.canoo.com/webtest/manual/setInputField.html

cheers
Dierk

> Am 03.04.2015 um 14:34 schrieb Nicholas Lievens =
<nicholas.lievens-D/[email protected]>:
>=20
> Hi all,
>=20
> =20
>=20
> I=E2=80=99m new to testing with WebTest. I=E2=80=99m trying to fill in =
some values on a form that is within a frame (e.g. =
announceVisitor$LastNameTextBox) . When executing the test it picks up =
the frame as it should but the test fails.  The reason for this I think =
is the fact that the contents of the form are not loaded (only the frame =
is). When I open the Error Page in the report I see the frame but it =
should contain the form and its contents (input fields) but it =
doesn=E2=80=99t. Does anyone have
>=20
> =20
>=20
> My test looks like  the following:
>=20
> =20
>=20
> =20
>=20
> <?xml version=3D"1.0"?>
>=20
> =20
>=20
> <!DOCTYPE project SYSTEM "../dtd/Project.dtd">
>=20
> =20
>=20
> <project default=3D"test">
>=20
>                 <target name=3D"test">
>=20
>                                <webtest name=3D"Login to MyApp">
>=20
>                                                <invoke =
url=3D"http://myurl.test"/>
>=20
>                                                <setInputField =
name=3D"Username" value=3D"999"/>
>=20
>                                                <setInputField =
description=3D"Set password field Password: 999" name=3D"Password" =
value=3D"999"/>
>=20
>                                                <clickButton =
label=3D"Login"/>
>=20
>                                                <followFrame =
name=3D"contents"/>
>=20
>                                                <clickElement =
xpath=3D"//td[text()=3D'Cell']"/>
>=20
>                                                <clickLink =
label=3D"MyLink"/>
>=20
>                                                <followFrame =
name=3D"main"/>
>=20
>                                                <selectForm =
name=3D"WebForm1"/>
>=20
>                                                <setSelectField =
htmlId=3D"hostEmployeeSelect" value=3D"User, Test"/>
>=20
>                                                <setInputField =
name=3D"announceVisitor$LastNameTextBox" value=3D"test"/>
>=20
>                                                <setInputField =
name=3D"announceVisitor$FirstNameTextBox" value=3D"test"/>
>=20
>                                                <setInputField =
name=3D"announceVisitor$EmailTextBox" value=3D"[email protected]"/>
>=20
>                                                <setInputField =
name=3D"announceVisitor$PlateNumberTextBox" value=3D"test"/>
>=20
>                                                <clickButton =
id=3D"okButton"/>
>=20
>                                </webtest>
>=20
>                 </target>
>=20
> </project>
>=20
> =20
>=20
> =20
>=20
> Best Regards,
>=20
> Nicholas                            =20
>=20
> -------------------------------------
>=20
> Dit e-mailbericht en alle documenten die ermee verzonden worden, zijn =
vertrouwelijk en uitsluitend bestemd voor gebruik door de persoon of de =
onderneming waaraan ze geadresseerd zijn.  Indien deze e-mail =
verkeerdelijk bij u terechtkomt, gelieve de afzender te verwittigen en =
deze bestanden van uw computer te verwijderen.
>=20
> Ce message e-mail ainsi que tous les fichiers transmis sont =
confidentiels et uniquement destin=C3=A9s =C3=A0 l'usage de la personne =
ou de l'entit=C3=A9 =C3=A0 qui ils sont adress=C3=A9s.  Si vous avez =
re=C3=A7u ce message e-mail par erreur, veuillez en informer =
l'exp=C3=A9diteur et le supprimer de tout ordinateur.
>=20
> This e-mail and any files transmitted with it are confidential and =
intended solely for the use of the individual or entity to whom they are =
addressed.  If you have received this e-mail in error please notify the =
sender and delete the material from any computer.
>=20
> Diese E-mail und alle mit ihr gesendeten Dateien sind vertraulich und =
sind nur f=C3=BCr den Empf=C3=A4nger und nicht f=C3=BCr kommerzielle =
Zwecke zugelassen. Falls Sie diese E-mail unberechtigterweise erhalten =
haben, informieren Sie bitte den Absender und l=C3=B6schen Sie alle hier =
relevanten Dateien.
>=20
> -------------------------------------
>=20