That’s some noisy and broken-looking code you have there.
First, read this and learn how to format code in a forum post.
Next, learn how to arrange an IF/ELSE block:
if(some condition is true) {
// do something
} else {
// do something else
}
Placing random {
and }
in your code is not going to work.
Next, you can reduce some of the “noise” by using variables:
def j1z1 = findTestObject('CXP_INT/Journey_Results_Check/Multiple_Journey_Objects/Zones_Travelled_Through/1st_Journey_1st_Zone')
def j1z2 = findTestObject('CXP_INT/Journey_Results_Check/Multiple_Journey_Objects/Zones_Travelled_Through/1st_Journey_2nd_Zone')
Then you can…
WebUI.verifyElementText(j1z1, "something")