属性xpath ="1"的含义是什么?在构造用于硒测试的定位器时 [英] What is the significance of the attribute xpath="1" while constructing locators for Selenium tests

查看:81
本文介绍了属性xpath ="1"的含义是什么?在构造用于硒测试的定位器时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

最近,我在基于角度的应用程序中偶然发现了一个属性为 xpath ="1" 的元素.

Recently I stumbled on an element with an attribute xpath="1" within an angular based application.

HTML:

我无法找到有关此属性的任何详细信息,并且在基于Selenium的测试的xpath/cssSelector中可能会产生影响和使用

I'm unable to find any details about this attribute and it's possible impact and usage within a xpath/cssSelector for the Selenium based tests.

有人可以在任何方向帮助我吗?

Can anyone help me out in any directions please?

推荐答案

该属性(xpath ="1")通过名为

That attribute (xpath="1") is placed there by a browser extension named CHROPATH. It is provided by a feature they call Dynamic Attribute Support.

向下滚动第一页将找到有关如何使用该工具的文字说明.

Scolling down the page one will find a text description of how to use the tool.

滚动到页面底部的注意:",或搜索注意:"在页面文字中.请特别注意注释#2.整个注释显示为:

Scroll to Note: at the bottom of the page, or search for "Note:" within the page text. Take special attention to note #2. The entire note reads:

注意:

  1. 仅对于一个选择器,将下拉列表中的选择器的值更改为rel XPath/abs Xpath/CSS sel头.
  2. 工具将按顺序出现的所有匹配节点添加xpath/css属性.例如,一个匹配的节点在列表中排名第二的将会是 xpath = 2 .如果验证CSS那么它将添加css = 2.
  3. 仅支持来自同一src的那些iframe.
  1. For one selector only, change the dropdown value from selectors to rel XPath/abs Xpath/CSS sel in header.
  2. Tool will add xpath/css attribute to all the matching node(s) as per their sequential occurrence. For example, a matching node appearing second in the list will have xpath=2. And if verifying CSS then it will add css=2.
  3. Supports only those iframe which are from the same src.

这篇关于属性xpath ="1"的含义是什么?在构造用于硒测试的定位器时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆