commons-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From James CE Johnson <jjohn...@ifleet.com>
Subject Re: Latka Questions
Date Fri, 22 Mar 2002 13:09:56 GMT
dion@multitask.com.au wrote:

>
> James CE Johnson <jjohnson@ifleet.com> wrote on 22/03/2002 03:07:58 AM:
>
> > Hi,,
> >
> > I've been looking at latka as a testing framework for our application
> > and have some specific questions that I can't find the answers to. 
> Would
> > this be the best place to ask?
>
> That and the best place to help us with the documentation so that it 
> keeps getting better. 


Great! I didn't want to spam the dev list with what will probably turn 
out to be usage questions.

I initially have two questions that will most likely lead into others.

Question 1 -- Selecting a form

Our app frequently has multiple forms per page. Depending on what the 
user chooses to do, one or the other will be submitted. How can I tell 
latka which form should receive the parameters defined in its input file?

For instance:

<ul>
<li><a href="javascript:editUser('james');">James</a>
...
</ul>

<a href="javascript:neverMind();"><img src="forgetIt.gif" border="0"></a>

<form name="editUserForm" action="EditUser.do">
<input type="hidden" name="userName"/>
</form>

<form name="neverMindForm" action="CancelProcess.do">
<input type="hidden" processName="editUser"/>
</form>

<script ...>
function editUser(theUser) {
  document.editUserForm.userName.value = theUser;
  document.editUserForm.submit();
}
function neverMind() {
  document.neverMindForm.submit();
}
</script>


Question 2 -- Preserving values for "playback"

In reality, the user add process would create users with automatically 
generated unique IDs. So instead of this:
    <li><a href="javascript:editUser('james');">James</a>
we would have this:
    <li><a href="javascript:editUser('1234');">1234</a> James</li>

In order to test the user-add process completely I would define my 
testcase along these lines:

A) Invoke AddUser.do
B) Populate that form with some test user data. Let's say the username 
is "TestUserFoo"
C) Submit the form
D) Invoke ListUsersForEdit.do
E) Apply an xpath along these lines to locate the user I just added:
     //li[contains(.,"TestUserFoo")]/a
(that may not be perfectly correct but you get the idea)
F) Use the getText() value of the 'a' element located to invoke 
DisplayUser.do?uid=whatever



Thanks,
James





--
To unsubscribe, e-mail:   <mailto:commons-dev-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:commons-dev-help@jakarta.apache.org>


Mime
View raw message