找到具有动态属性的元素
我一直在使用Selenium Java和HTML更改中的每个运行元素属性进行一些测试。我正在使用Selenium 4.1.2和MVN 3.8.5从IntellijIDE中测试一个完整的Web应用程序,而Web App .Net和Angular 13。 知道这个问题的原因是什么?
I ve been running some tests using selenium java and after every run element attributes in HTML change. I am testing a full web app from intellij ide using selenium 4.1.2 and mvn 3.8.5 while the web app .NET and Angular 13.
Any idea what is the cause of this problem ?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您可以通过两个mwthods找到它,如果部分属性值是静态的,剩余的值是动态的,请说id = abc123,而123是动态的,而ABC是静态的,请尝试将XPath尝试与contains(@ID,'abc' )或尝试找到一个静态和使用以下方法的先前元素来遍历和找到此元素
You can locate it by two mwthods 1) if part of the attribute value is static and the remaining value is dynamic lets say id=ABC123 and the 123 is dynamic and ABC is static try to use xpath with contains (@id,'ABC') or try locate the previous element which is static and use following method to traverse and locate this element