自动化常用元素定位

1第二个li下的div  
  li:nth-child(2) div {
2第一个item下的aaa
from1css=".aaa  .bbb:nth-child(1) .ccc"
3两个button并列选择第二个
itcss=".aaa button:nth-child(2)"
4兄弟组件
/* 选择紧跟在 h1 元素后的 p 元素并设置其颜色为红色 */
    h1 + p {
      color: red;
    }

    /* 选择 h1 元素后面的所有 p 元素并设置其字体大小为 20px */
    h1 ~ p {
      font-size: 20px;
    }
5 css         div的属性data-id为FraudReviewGMI
k2css="div[data-id='FraudReviewGMI']>div>div>div"
6  css      属性data-id为basic_income 
k2css="[data-id='basic_income'] input"

xpath
1   li元素的文本为123456
toselect1css="//li[text()='123456']"

2  元素aaa包含文本123456
//*[@class='aaa' and contains(text(),'123456')]

3  元素aaa且文本为123456
//*[@class='myClass' and text()='aaa']

4 li role="option" 并且文字为no 用xpath表示
//li[@role='option' and text()='no']

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值