okej, so:
i've got code like this:

var testStr : String = ""

def set(s : String) : JsCmd ={
println(s)
testStr = s
JsRaw("")
}

def render(ns : NodeSeq) : NodeSeq ={
bind("fields", ns,
"name" -> SHtml.ajaxText(testStr, (s : String) => setName(s) ) % ("id"
-> "name"),
...
}

and JUnit test with Selenium like this:

class FirstSeleniumTest extends SeleneseTestCase  {
    //    @Before
    override def setUp: Unit = {
        super.setUp("http://localhost:8080/";, "*firefox")
        selenium.windowMaximize()
    }
    //    @After
    override def tearDown: Unit = {
       selenium.close
    }
    //    @Test
    def testFirst = {
    selenium.open("/")
    selenium.waitForPageToLoad("30000")
    selenium.`type`("name","new value")
    ...
    }
}

finally i'm running it from maven by: mvn test -
Dtest=FirstSeleniumTest (jetty is running in other console)

all of this is looking fine, selenium is working, "new value" is put
in my ajaxText field, but the setName function is not call - i'm not
get any log in console where jetty is running

On 3 Mar, 10:40, Jeppe Nejsum Madsen <[email protected]> wrote:
> On Wed, Mar 3, 2010 at 10:30 AM, Tweek <[email protected]> wrote:
> > Hi,
>
> > I'm writting Selenium tests with Scala JUnit.
>
> > The problem is when i try to put value in SHtml.ajaxText field.
> > Selenium RC doesn't call my js function from this ajaxText.
>
> Not sure exactly what you mean by the above, but IIRC, the ajax
> request is not triggered by simply setting a value in a field but when
> you exit the field (onBlur).
>
> Also note that the fields usually get a unique id for each new page
> view. To get stable identifiers you should run in test mode (see the
> list for details)
>
> I'll be interested in your results as we probably have to do something
> similar soon :-)
>
> /Jeppe

-- 
You received this message because you are subscribed to the Google Groups 
"Lift" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit this group at 
http://groups.google.com/group/liftweb?hl=en.

Reply via email to