3 ms·
Not necessarily. For instance, in many (most?) SPAs, forms are just a... formality. Something to get your Bootstrap-based (or equivalent) CSS to look proper, bu
by moogly 10y ago
Not necessarily. For instance, in many (most?) SPAs, forms are just a... formality. Something to get your Bootstrap-based (or equivalent) CSS to look proper, but the actual form data is pre-processed in JavaScript and sent via an XMLHttpRequest.
- onion2k 10y agoEven if you're not using the name in the form data you're still giving it meaning and importance by using it in a locator - you're saying "find the specific element in the page that has the name 'FullName'". If you don't actually care what the name is then you should use something else, like an ID attribute.
- moogly 10y agoSure, I don't necessarily disagree with the sentiment you're expressing, I'm just saying that today, HTML forms aren't as tied to the backend as they used to be. Though personally I wouldn't want to have to start adding ids and names to things in the markup just for Selenium to find them.