jeudi 3 mai 2018

Identifying elements on a ReactJS webpage using Selenium, is their a better way?

I am trying to write web driven tests using Selenium on a webpage built with reactjs. I am able to grab my elements by xpath however this is not ideal and very limiting. 1. If any changes happen to the website the xpath will not work. 2. all the class names are identical with no other attributes to grab, as well the class names change because they are dynamically built by react. 3. There are no other attributes to use. 4. Cant use the CSSSelector because the css name is also built by react.

My main problems keep popping up when I want a specific element, like one I just built or how to manipulate a specific one in a list.

I keep getting stumped on the same problem for each test I try to write, no unique identifiers. I am not familiar with reactJs but is this a common problem with Selenium?

Aucun commentaire:

Enregistrer un commentaire