Test fails but returns true in console

So as in the screenshot below, the ‘titlename’ variable does contain a date that is in the list of ‘titles’ generated to the console.

However, the test is failing.

Here’s the lines of code:

String titlename = WebUI.callTestCase(findTestCase('FourteenFish/Modules/FourteenFish/FF_Create_Educators_Note'), ['title': CustomKeywords.'custom.general.timeDateStamp'()], 
    FailureHandling.STOP_ON_FAILURE)

assert titles.contains(titlename)

The output of ‘title’ from the test case I’ve called, should then be inputted into String titlename, but it instead returns true as in the console.

Does anyone know why?

I’m guessing the Test Case FF_Create_Educators_Note returns a boolean (true/false). The value true and the value false does not contain the String you’re looking for.

Make sure your Test Case returns the String you need:

  // imports here

  // test case code here

  return "My String"

Great! You solved it.

I added the return statement:

return title

to the end of that test case and it worked! Thanks so much

2 Likes