My current challenge involves automating a StaticText field on an iOS device using Appium. I have been successful in retrieving the text and displaying it.
Object value = js.executeScript("UIATarget.localTarget().frontMostApp().mainWindow().collectionViews()[0].cells()[0].staticTexts()[\"abc\"].value();");
System.out.println(value);
Sample Output: From 20/min
However, due to the random nature of the value, each test run produces a different output. This inconsistency makes it difficult to assert a static value during testing.
Is there a way to pass the test regardless of the varying values obtained with each test run?