[Webtest] verifyTitle step fails

Paul King Paul King <paulk@asert.com.au>
Sat, 04 Nov 2006 15:36:49 +1000


Try replacing your verifyTitle step with:

<groovy>
junit.framework.Assert.assertEquals("Explorer: View 'OCA82 - Single Wholesaler / Product Variability'", step.context.currentResponse.titleText)
</groovy>

The script will likely fail your ant run and not generate reporting
but it might give you some additional info, e.g. when changing the
case of a letter I get:

BUILD FAILED
junit.framework.ComparisonFailure: expected:<...s...> but was:<...S...>


Tim Miller wrote:
> Any ideas why this verify title step would fail?  If you search from 
> browser or text editor on the trace the two strings seem to match 
> exactly.  I have a number of identical tests that pass but this 
> particular title does not pass.  We are on build R_1351.
> 
>  
> 
> Thanks,
> 
> Tim
> 
>  
> 
>     <verifyTitle description="Check View Title" text="Explorer: View 
> '${view.name}'" />
> 
>  
> 
>  
> 
> Trace output:
> 
>  
> 
> com.canoo.webtest.engine.StepFailedException: Wrong document title 
> found! Expected "Explorer: View 'OCA82 - Single Wholesaler / Product 
> Variability'" but got "Explorer: View 'OCA82 - Single Wholesaler / 
> Product Variability'", Step: VerifyTitle at 
> C:\home\qauser01\toolsv351\PortalTests\tests\AnalyticsModule\AnalyticsViewFunctions.xml:32: 
> with (description="Check View Title", taskName="verifyTitle", 
> text="Explorer: View 'OCA82 - Single Wholesaler / Product Variability'")
> 
>  
> 
>  
> 
> (This email message is for the sole use of the intended recipient(s) and 
> may contain confidential information.  Any unauthorized review, use, 
> disclosure or distribution is prohibited.  If you are not the intended 
> recipient, please contact the sender by reply email and destroy all 
> copies of the original message.)
> 
>  
>