Trouble with clearText

3 views
Skip to first unread message

kamundse

unread,
Jul 9, 2010, 7:02:34 PM7/9/10
to tellurium-users
Hello,

I am not sure what I am doing wrong with clearText. This function was
working before but it is not anymore.

In my DslContext class I have the following code:

uiModName = "createAccount";

public void defineUi()
{
ui.Form(uid: uiModName, clocator: [tag: "form", method: "post",
action: "https://www.mysite.com/signup.jsp"])
{
InputBox(uid: "email", clocator: [id: "email"])
InputBox(uid: "newPassword", clocator: [id: "newPassword"])
InputBox(uid: "newPassword2", clocator: [id: "newPassword2"])
InputBox(uid: "firstName", clocator: [id: "firstName"])
InputBox(uid: "lastName", clocator: [id: "lastName"])
}
}
public void clearForm()
{
clearText uiModName + ".email"
clearText uiModName + ".newPassword"
clearText uiModName + ".newPassword2"
clearText uiModName + ".firstName"
clearText uiModName + ".lastName"
}

My html file has:

...
<input type="text" name="email" maxlength="80" id="email" value="" />
...
<input type="password" name="newPassword" maxlength="20"
id="newPassword" />

and so on. All of those id's exist in the html file.

The error I am getting is:

com.thoughtworks.selenium.SeleniumException: ERROR: Element
uimcal={"rid":"createAccount.newPassword","locator":"jquery=#newPassword"}
not found
at
com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:
97)
at
com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:
91)
...

back to every one of the clearText calls in the clearForm()
function.

But this function also in that DslContext class works fine:

public void fillOutForm(String email, String password, String
password2, String fn, String ln) throws SeleniumException
{
type uiModName + ".email", email
type uiModName + ".newPassword", password
type uiModName + ".newPassword2", password2
type uiModName + ".firstName", fn
type uiModName + ".lastName", ln
}

Any ideas why the clearText calls fail when the type calls work?

Jian Fang

unread,
Jul 9, 2010, 9:12:44 PM7/9/10
to telluri...@googlegroups.com
Hi,

clearText actually calls the type() command under the hood as shown in the code

    def clearText(WorkflowContext context, String locator, String[] events) {
        String[] defaultEvents = null
        if(extraEvent)
           defaultEvents = ["focus", "mouseOver", "mouseOut", "blur"]

        processEvents(context, locator, events, defaultEvents){
           cbp.type(context, locator, "")
        }
    }

I suspect this may not be a clearText() command problem, but a ui module definition problem.

Could you try the following to validate the whole UI module

validate("createAccount");

or call the following methods to validate each UI?

  diagnose uiModName + ".email"
  diagnose uiModName + ".newPassword"
  diagnose uiModName + ".newPassword2"
  diagnose uiModName + ".firstName"
  diagnoset uiModName + ".lastName"

Please let us know what are the output.

Thanks,

Jian


--
You received this message because you are subscribed to the Google Groups "tellurium-users" group.
To post to this group, send email to telluri...@googlegroups.com.
To unsubscribe from this group, send email to tellurium-use...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/tellurium-users?hl=en.


kamundse

unread,
Jul 15, 2010, 1:57:50 PM7/15/10
to tellurium-users
UI Module Validation Result for createAccount

-------------------------------------------------------

Found Exact Match: true

Found Closest Match: false

Match Count: 1

Match Score: 100


-------------------------------------------------------

But it also threw an exception:

com.thoughtworks.selenium.SeleniumException: ERROR: Command execution
failure. Please search the Tellurium User Group at
http://groups.google.com/group/tellurium-users for error details from
the log window. The error message is: Result of expression
'$relaxed' [null] is not an object.
at
com.thoughtworks.selenium.HttpCommandProcessor.throwAssertionFailureExceptionOrError(HttpCommandProcessor.java:
97)
at
com.thoughtworks.selenium.HttpCommandProcessor.doCommand(HttpCommandProcessor.java:
91)
at sun.reflect.GeneratedMethodAccessor93.invoke(Unknown Source)
...

However, diagnose command helped me find the issue. I realized my
test page that I am working on redirects back to the real page (which
does not have the email id on it) if you fail a data check and the
page reloads.

Thanks!

Jian Fang

unread,
Jul 15, 2010, 2:41:26 PM7/15/10
to telluri...@googlegroups.com
That is wired. I will create a test case for you tonight.

Thanks,

Jian


--

Jian Fang

unread,
Jul 16, 2010, 11:07:33 AM7/16/10
to telluri...@googlegroups.com
Sorry, I couldn't find any time last night. I will do that during the weekends.

Thanks,

Jian

Jian Fang

unread,
Jul 19, 2010, 9:36:44 AM7/19/10
to telluri...@googlegroups.com
Hi,

I did tried your test case with Tellurium 0.8.0 trunk and it worked fine, see the test case here:

http://code.google.com/p/aost/source/browse/trunk/core/src/test/groovy/org/telluriumsource/ft/LogonTestCase.java

Be aware, you need to use Tellurium Engine, i.e., selenium-server-1.0.1-te4-snapshot.jar either from our Maven
repo or go the trunk engine project and run ant task, the new jar is under the lib directory.

Let us know if you can run the test case successfully against your real web site.

Thanks,

Jian
Reply all
Reply to author
Forward
0 new messages