硒4中的相对定位符是什么,它的类型是什么?

问题描述 投票:-1回答:3

我最近听说了硒4中的相对定位符。那到底是什么,它是什么类型?

其次,它将如何帮助找到与当前定位符不同的元素,例如(id,name,tagname,classname,cssselector,xpath,linktext,partiallinktext)。

selenium automation ui-automation
3个回答
1
投票

这是一种根据元素相对于其他元素的位置(在...上方,下方,右侧...)查找元素的新方法。这是硒文档的链接:https://github.com/SeleniumHQ/selenium/blob/master/java/client/test/org/openqa/selenium/support/locators/RelativeLocatorTest.java


1
投票

主定位符是tagName


1
投票

我写了一篇博客文章,解释了新方法,它们如何工作以及陷阱。http://angiejones.tech/selenium-4-relative-locators/

© www.soinside.com 2019 - 2024. All rights reserved.