Struggling with Selenium XPath? How Do You Write Reliable Locators? or What’s Your Go-To Method for D

14 Replies, 857 Views

Bro, selenium xpath is a nightmare until you get the hang of it.

My rule? NEVER use absolute paths. They break if the devs even sneeze on the HTML.

Instead, chain attributes like `//input[@name='email' and @type='text']`. Makes it way more specific without being fragile.

And yeah, sometimes you gotta pray. But `contains()` is my go-to for dynamic stuff.

Messages In This Thread



Users browsing this thread: 1 Guest(s)