I am finding it really hard to locate stuff I am testing when its deep nested, etc.
Is it a bad idea to use something
<h1 name="test-main-title">About Us</h1>
The idea itself is similar to modifying application or a specific application build for testing or staging to make the testing easier. The idea itself is quite common and has its pros and cons. I don't though particularly like the idea of changing existing attribute values for that. Instead, think about adding meaningful
ids and data-oriented
classes or other attributes.
ids specifically have multiple advantages - they are less likely to be changed, they are unique (at least they should in theory), they are data-oriented (meaning, you probably would not have an id equal to
col-sm-6) and they are the fastest way to locate elements.
Also, here are the related threads with more ideas: