not+verifyText failing in Groovy?

View: New views
4 Messages — Rating Filter:   Alert me  

not+verifyText failing in Groovy?

by bestguy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Hi,

I'm using 3.1's Groovy WebtestCase support, and seeing a failure with
the 'not' step.
I'm trying to verify text (certain character combos) is not present in a page.

Example:

webtest('Blah') {
    invoke("http://localhost:8080/somepage.tmpl")
    not(verifyText(text: 'blah'))
}


Fails with:

"Message

Step[verifyText (2/3)]: Text not found in page. Expected <blah>"


Am I missing something or is this a bug?
_______________________________________________
WebTest mailing list
WebTest@...
http://lists.canoo.com/mailman/listinfo/webtest

RE: not+verifyText failing in Groovy?

by Jonathan Rosenberg-2 :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

I'm a novice Webtest/Groovy user, but I'm guessing that veryfyText doesn't
know it's nested in "not", so it executes its normal path: compare text &
complain if it doesn’t match.

Try this using some text that IS in the page & see what happens?  I would
think that the NOT would complain.

--
Jonathan Rosenberg
Founder & Executive Director, Tabby's Place
http://www.tabbysplace.org/



-----Original Message-----
From: webtest-admin@... [mailto:webtest-admin@...]
On Behalf Of Gary Thomas
Sent: Saturday, October 10, 2009 4:03 PM
To: webtest@...
Subject: [Webtest] not+verifyText failing in Groovy?

Hi,

I'm using 3.1's Groovy WebtestCase support, and seeing a failure with
the 'not' step.
I'm trying to verify text (certain character combos) is not present in a
page.

Example:

webtest('Blah') {
    invoke("http://localhost:8080/somepage.tmpl")
    not(verifyText(text: 'blah'))
}


Fails with:

"Message

Step[verifyText (2/3)]: Text not found in page. Expected <blah>"


Am I missing something or is this a bug?
_______________________________________________
WebTest mailing list
WebTest@...
http://lists.canoo.com/mailman/listinfo/webtest

_______________________________________________
WebTest mailing list
WebTest@...
http://lists.canoo.com/mailman/listinfo/webtest

Re: not+verifyText failing in Groovy?

by Dierk König :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

try 

webtest('Blah') {
    invoke("http://localhost:8080/somepage.tmpl")
    not { verifyText(text: 'blah') }
}

nested steps have to be in curly braces.

cheers
Dierk

Re: not+verifyText failing in Groovy?

by bestguy :: Rate this Message:

Reply to Author | View Threaded | Show Only this Message

Duh - thanks!   Works great now

Best,
Gary

On Oct 10, 2009, at 2:35 PM, Dierk König <dierk.koenig@...> wrote:

try 

webtest('Blah') {
    invoke("http://localhost:8080/somepage.tmpl")
    not { verifyText(text: 'blah') }
}

nested steps have to be in curly braces.

cheers
Dierk