4

I'd like to generate id's for almost every element in my website, to have an easier time handling elements for Selenium tests. Is this a good approach? My application changes quite a bit.

I can't seem to add the id HTML attribute to the React component, because React interprets it as props e.g.

<NewEl id='test'/>

... and NewEl gets id props instead of attribute. Sometimes I can't access the React component because I use third party components.

How should I change that id attribute? Is my approach a good solution?

Kalnode
  • 9,386
  • 3
  • 34
  • 62
Patryk Janik
  • 2,476
  • 2
  • 13
  • 23

0 Answers0