-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Description
We have confirmed the phenomenon that the AutomationId attribute is not generated correctly when generating xpath using UIRecorder.
After reading the source code, the possible causes are as follows.
In the AutomationId path generation process, there is a description that generates a path in starts-with format if the count that matches the regular expression (^([^¥d]*)[_¥.¥-¥d]+$) is equal to or greater than 2, there is a description that generates the path in starts-with format.
For example, a string ending with a number such as textBox1 falls under this category, so the path will be generated in the starts-with format as follows.
Edit[starts-with@AutomationId,\"textBox\")]
Why do an ambiguous search for starts-with when you can get a value that uniquely identifies the element textBox1?
In fact, when I created textBox1 and textBox2 and retrieved their xpaths, they generated exactly the same path, even though the elements were different.

