Discussion:
[Webtest] help login page
mamtha lalith
2006-12-07 13:01:18 UTC
Permalink
hello everyone,

i have been looking at canoo webtest since past 4 5
days and it looks really intresting as i wanted to use
for my project.
i have written some xml files to test my application
with around 75% of success.
my first page is a login page so i wrote the following
module
<steps>
<invoke description="Welcome" url=""/>
<setInputField description="set username"
value="${Login ID}" name="id"/>
<verifyInputField description="set username"
name="id" value="${Login ID}" />
<setInputField description="set password" value="a"
name="password"/>
<verifyInputField description="set password"
name="password" value="a"/>
<clickButton label="Sign In" description="Click the
submit button"/>

</steps>
and i did had this build successful when run on my
command prompt.
i had u/n and password of a and a respectively which i
tried it succesfully on both test and application
when i tried to change the username and password to
something else say abc and abc respectively the test
was also successful, and obviously the u/n and pwd
didnt work on my application directly , i was
surprised and thought how to check the dynamically the
page authentication, like the test only recognises the
u/n and pwd (whatever it might be) set in the test
build rather than actual original values of the
application, is there any other way to do this .

and i have another problem with clickbutton its fine
untill the button is of type submit but when the
button is of type button it says no button was found
on the page.

hope, I ll have my questions answered by the
exprienced proffessionals here
thanking you

MamthaLalith



____________________________________________________________________________________
Any questions? Get answers on any topic at www.Answers.yahoo.com. Try it now.
Marc Guillemot
2006-12-07 14:12:52 UTC
Permalink
Hi,

I'm not sure to fully understand your problem therefore I can make only
some remarks:

- your verifyInputField steps are quite useless here or do you want to
test your test? ;-)
- such a script will work with correct as well as with incorrect
username / password as long as you don't perform some verification to
check what you expect to receive after the clickButton

Concerning buttons, clickButton should find buttons of type "button"
too. Are you sure that your html is correct? This is most of the time
the origin of the problem.

Marc.
Post by mamtha lalith
hello everyone,
i have been looking at canoo webtest since past 4 5
days and it looks really intresting as i wanted to use
for my project.
i have written some xml files to test my application
with around 75% of success.
my first page is a login page so i wrote the following
module
<steps>
<invoke description="Welcome" url=""/>
<setInputField description="set username"
value="${Login ID}" name="id"/>
<verifyInputField description="set username"
name="id" value="${Login ID}" />
<setInputField description="set password" value="a"
name="password"/>
<verifyInputField description="set password"
name="password" value="a"/>
<clickButton label="Sign In" description="Click the
submit button"/>
</steps>
and i did had this build successful when run on my
command prompt.
i had u/n and password of a and a respectively which i
tried it succesfully on both test and application
when i tried to change the username and password to
something else say abc and abc respectively the test
was also successful, and obviously the u/n and pwd
didnt work on my application directly , i was
surprised and thought how to check the dynamically the
page authentication, like the test only recognises the
u/n and pwd (whatever it might be) set in the test
build rather than actual original values of the
application, is there any other way to do this .
and i have another problem with clickbutton its fine
untill the button is of type submit but when the
button is of type button it says no button was found
on the page.
hope, I ll have my questions answered by the
exprienced proffessionals here
thanking you
MamthaLalith
____________________________________________________________________________________
Any questions? Get answers on any topic at www.Answers.yahoo.com. Try it now.
_______________________________________________
WebTest mailing list
http://lists.canoo.com/mailman/listinfo/webtest
Michael Habbert
2006-12-08 07:40:14 UTC
Permalink
Hi mamtha lalith,

As I see it you have done a half test.

First Call your Start-URL:
<invoke description="get Login Page" url="/"/>
Check the Title of the Page:
<verifytitle description="we should see the login title" text="###Title###" regex="true"/>
Set u/n and password
<setinputfield description="set user name: #{chewi.user}" name="loginName" value="#{chewi.user}"/>
<setinputfield description="set password" name="password" value="#{chewi.password}"/>
Click Submitt:
<clickButton description="Click the submit button" label="${button.login}" />
Check the successfull Login!!!! Like store the cookie:
<storeCookie description="storecookie" name="JSESSIONID" property="webtest.cookie.jsessionid"/>
<verifyProperty description="verify cookie" name="webtest.cookie.jsessionid" text=".*" regex="true"/>
Check the first page of your application.
<verifytitle description="Startseite" text="Schreibtisch.*" regex="true" />

This is the main source of our login-modul we use in each test.
Hopefully it helps
Yours
Michael Habbert

[...]
Post by mamtha lalith
Post by mamtha lalith
hello everyone,
i have been looking at canoo webtest since past 4 5
days and it looks really intresting as i wanted to use
for my project.
i have written some xml files to test my application
with around 75% of success.
my first page is a login page so i wrote the following
module
<steps>
<invoke description="Welcome" url=""/>
<setInputField description="set username"
value="${Login ID}" name="id"/>
<verifyInputField description="set username"
name="id" value="${Login ID}" />
<setInputField description="set
password" value="a"
Post by mamtha lalith
name="password"/>
<verifyInputField description="set password"
name="password" value="a"/>
<clickButton label="Sign In"
description="Click the
Post by mamtha lalith
submit button"/>
</steps>
[...]

Mit freundlichen Grüßen
------------------------------------------------------------------------
Michael Habbert

Senior Developer
Netpioneer GmbH, Beiertheimer Allee 18, D-76137 Karlsruhe

Tel: 0721 / 920 60 21
Fax: 0721 / 920 60 30
E-Mail: ***@netpioneer.de
www: http://www.netpioneer.de
mamtha lalith
2006-12-08 08:21:02 UTC
Permalink
Thanks Marc and Michael
for the reply and now i know what i have been doing
wrong i just changed my xml file slightly and it
worked
here is my new test file when i gave wrong username or
password still it cameout successfull but the response
page which generated showed me the exact response of
page what wud it happened if the values were incorrect
:D
<project name="property" basedir="." default="main">
<property name="webtest.home" location="c:/canoo"/>
<property name="id" value="a" />
<property name="password" value="a" />
<import file="${webtest.home}/lib/taskdef.xml" />
<target name="main">
<webtest name="new Test" >
<config
host="" protocol="http" port="8080"
basepath="profile" summary="true" saveresponse="true"
resultfile="exactlogin.xml"/>
<steps>
<invoke description="start page" url="" />
<setInputField description="username" name="id"
value="${id}" />
<setInputField description="password" name="password"
value="${password}" />
<clickButton label="Sign In" description="Click
Submit Button" />
<verifyText description="The Authenticated Page"
text="Reg"/>

</steps>
</webtest>
</target>
</project>


thanks for ur help

and regarding the click button the button of type
button seems to be not working and my HTML seems to
have no problem too, i still cant get it done
though i have seen in some archive about the maven
plug in, I did download it yesterday i didnt knew how
actually to use that plugin

thanks again
with regards,
MamthaLalith



____________________________________________________________________________________
Do you Yahoo!?
Everyone is raving about the all-new Yahoo! Mail beta.
http://new.mail.yahoo.com

Continue reading on narkive:
Loading...