What is the recommended approach for locating elements whose IDs are dynamically generated and change on every page load?
-
A
Use By.id() with a wildcard pattern
-
B
Use By.cssSelector() with a stable data-testid attribute
-
C
Use absolute XPath from the root
-
D
Use By.tagName() and iterate through results