我最近听说了硒4中的相对定位符。那到底是什么,它是什么类型?
其次,它将如何帮助找到与当前定位符不同的元素,例如(id,name,tagname,classname,cssselector,xpath,linktext,partiallinktext)。
这是一种根据元素相对于其他元素的位置(在...上方,下方,右侧...)查找元素的新方法。这是硒文档的链接:https://github.com/SeleniumHQ/selenium/blob/master/java/client/test/org/openqa/selenium/support/locators/RelativeLocatorTest.java
主定位符是tagName
我写了一篇博客文章,解释了新方法,它们如何工作以及陷阱。http://angiejones.tech/selenium-4-relative-locators/