当前位置:网站首页>元素定位不到的 9 种情况
元素定位不到的 9 种情况
2022-06-25 11:29:00 【大田测试录】
大家好啊,我是大田。
1、有可能定位的方式不是唯一的,比如:你用 id 定位,对应的元素不唯一;遇到的元素在运行时是动态加载的,这时也定位不到;
2、代码是否写的不对:需要确认定位方式、定位信息、所在页面正确;
3、没有加合理的等待,有时我们的网速不好、内存不够页面就会加载不出来;
4、元素嵌套在了 frame 框架中,有时候我们定位元素时,换了几种方式都定位不到,注意可能嵌套在 frame 框架中了,这时我们需要切换到 frame 中;
5、浏览器开了新窗体,如:你在 a 页面,打开了 b 页面,这时想操作 b 页面的元素,无法操作,原因就是元素的 driver 有指向,指向的就是 a 页面;这时采取切换窗体;
6、定位到元素后无法操作,可能是遮挡和覆盖,可以利用鼠标悬浮到其他位置,这样遮挡就会消失;
7、当你定位到元素后,提示了警告框、提示框,需要先处理这两个框;
8、元素是否是可见的,如:元素中有个属性是不可见的,那我们无论如何都是定位不到。
9、在当前页面并未展示到目标元素,我们可以利用边滚动边查找的方式。
以上就是大田今天的分享,如果你觉得有用,可以给大田点个赞~
推荐文章:
2022.06.24,是大田日更第 139 / 365 天。每篇文章解决某个具体问题。
边栏推荐
猜你喜欢
芯片的发展史和具体用途以及结构是什么样的
SQL injection vulnerability (bypass)
A difficult mathematical problem baffles two mathematicians
Ladder side tuning: the "wall ladder" of the pre training model
仿真与烧录程序有哪几种方式?(包含常用工具与使用方式)
Shichuang energy rushes to the scientific innovation board: it plans to raise 1.1 billion yuan, with an annual revenue of 700million yuan and a 36% decrease in net profit
SQL注入漏洞(类型篇)
牛客网:分糖果问题
Detailed explanation of spark specification
Database Series: MySQL index optimization summary (comprehensive version)
随机推荐
推荐一款M1电脑可用的虚拟机软件
wait()、notify()和notifyAll()、sleep()、Condition、await()、signal()
Use of comparable (for arrays.sort)
時創能源沖刺科創板:擬募資11億 年營收7億淨利反降36%
基于超算平台气象预警并行计算架构研究
GaussDB 集群维护案例集-sql执行慢
芯片的发展史和具体用途以及结构是什么样的
Handler、Message、Looper、MessageQueue
金仓数据库 KingbaseES 插件dbms_session
Design and implementation of university laboratory goods management information system based on SSH
CFCA安心签接入
GC
C disk uses 100% cleaning method
查询法,中断法实现USART通信
Jincang database kingbasees plug-in force_ view
手机上股票开户安全吗?找谁可以开户啊?
Double tampon transparent cryptage et décryptage basé sur le cadre minifilter
[shangyun boutique] energy saving and efficiency improvement! Accelerating the transformation of "intelligent manufacturing" in the textile industry
Jincang KFS data cascade scenario deployment
Tidb applicable scenarios