kevin halili
kevin halili

Reputation: 50

Locating elements with dynamic attributes

I ve been running some tests using selenium java and after every run element attributes in HTML change. I am testing a full web app from intellij ide using selenium 4.1.2 and mvn 3.8.5 while the web app .NET and Angular 13. Any idea what is the cause of this problem ?

Upvotes: 0

Views: 134

Answers (1)

Bâlà
Bâlà

Reputation: 51

You can locate it by two mwthods 1) if part of the attribute value is static and the remaining value is dynamic lets say id=ABC123 and the 123 is dynamic and ABC is static try to use xpath with contains (@id,'ABC') or try locate the previous element which is static and use following method to traverse and locate this element

Upvotes: 1

Related Questions