@Test public void unsuccessfulSignUp() { String incorrectUserName = RandomForPages.randomStringWithInvalidSymbols(); thrown.expectMessage("Not on the right page"); SignUpResultPage resultPage = signUpPage.signUp(incorrectUserName, password, password, "", correctEmail); Assert.assertEquals(" Oops!", resultPage.getMessageText()); }