It sounds like you're trying to tap the "Search" button in the keyboard. The accessibility labels on return keys don't follow any sort of sane pattern. Looking in the accessibility inspector, you'll see "SEARCH" but that may not be consistent on all OS versions.
Update
You can trigger the search button by adding \n
to your enterText...
[tester enterTextIntoCurrentFirstResponder:@"query\n"];