I am testing a mobile application, and haven't had any issues mapping out and identifying all of the accessibility id's so far within the application but I am stuck on not being able to identify one case in particular...
I have a case where one of the accessibility id is very long in the form of "The password must have between 8 and 16 characters. It must contain at least 1 number, 1 letter, and 1 non-alphanumeric characters". When I specify this accessibility in my code, I keep getting consistent errors that the element can't be found. Is there a workaround for this, to maybe shorten this or any other solution?
I've tried searching around for this solution, but haven't been able to find anything and have been stuck on this the past day. Please help :)
String actual_error= driver.findElementByAccessibilityId("The password must have between 8 and 16 characters. It must contain at least 1 number, 1 letter, and 1 non-alphanumeric character").getText();
String expected_error= "The password must have between 8 and 16 characters. It must contain at least 1 number, 1 letter, and 1 non-alphanumeric character";
Assert.assertEquals(actual_error, expected_error);