[英]How to get the absolute XPath for an element using JavaFX, if the element doesn't have any attributes, like id, name, css etc
如果元素不具有id,name,css等任何属性,如何使用JavaFX获取元素的绝对XPath
html/body/tr/td[3]/div[2]/input
If it's parents have any unique properties and it is a single child, you can find it's parent and direct it to its child. 如果它的父母具有任何独特的属性并且是一个独生子女,则可以找到它的父母并将其定向到它的孩子。
html/body/tr/td[@class="classname"]/div[@id="idp"]/input HTML /体/ TR / TD [@类= “类名”] /格[@ ID = “IDP”] /输入
You can also find it's child if that has any unique identifiers and then direct it to its parent, so the xpath would look like 您还可以找到具有唯一标识符的子对象,然后将其定向到其父对象,因此xpath看起来像
// [@id="inputfieldchild"]/parent:: // [@ id =“ inputfieldchild”] /父::
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.