Pros/cons for using multiple locators per element in Selenium?

后端 未结 1 1760
广开言路
广开言路 2021-02-04 16:58

I am testing a website which is still in development.

Often an element\'s id, class, text, or position in the DOM will change. And then the locator I\'ve been using wil

相关标签:
1条回答
  • It's an interesting approach, but I'm concerned you might be masking other issues. I'd prefer to work more closely with the developers to avoid breaking UI issues in the first place.

    Are the changing IDs dynamically produced? If that's the case, look to see if you can't get a suffix on the IDs, something like _loginlink. You might also have to work with an XPath that starts from a nearby static ID: "//div[@id='login_link_container'/a". (Starting from the root of the document like your example shows is a recipe for pain! :) )

    0 讨论(0)
提交回复
热议问题