Software_programming_automation_selenium
10:52:37
Table 获取 tr list


注意会无法正常遍历获取。

修正后正常
1 public SelectionCriteriaPage checkSpecifyTag(int count){
2 String gridXpath = "//div[@id='NewSelectionParentGridPlaceholder']//div[@id='gridPlaceHolder']//div[@class='dataTables_scrollBody']//table[@id='DataTables_Table_0']/tbody";
3 new WebDriverWait(driver,120).until(ExpectedConditions.presenceOfElementLocated(By.xpath(gridXpath)));
4 WebElement gridCandidate = driver.findElement(By.xpath(gridXpath));
5 List<WebElement> candidateList = gridCandidate.findElements(By.tagName("tr"));
6
7 int iteratorCount = Math.min(candidateList.size(),count);
8
9 for(int i = 0; i< iteratorCount; i++){
10 /* WebElement parent = candidateList.get(i);
11 WebElement mid = parent.findElements(By.tagName("td")).get(0);
12 WebElement current = mid.findElement(By.tagName("input"));*/
13
14 WebElement current = candidateList.get(i).findElements(By.tagName("td")).get(0).findElement(By.tagName("input"));
15
16 //WebElement current = candidateList.get(i).findElement(By.xpath("//td[1]/input"));
17 new WebDriverWait(driver,120).until(ExpectedConditions.elementToBeClickable(current));
18 JSExecutor.jsScrollIntoView(current);
19 current.click();
20 }
21 return this;
22 }
Software_programming_automation_selenium的更多相关文章
随机推荐
- (14)go-micro微服务服务层Handle开发
目录 一 Handle层开发功能说明 需要完成的服务开发功能: 从哪找需要开发的功能 二 代码编写 三 最后 一 Handle层开发功能说明 需要完成的服务开发功能: 登录 注册 查询用户信息 修改信 ...
- CentOS7下配置使用JumpServer 堡垒机 (图文教程)
前面介绍了如何在<CentOS7下搭建JumpServer 堡垒机>,基于这篇文章的环境搭建过程,接着介绍安装后的的功能配置使用. 首次wbe登录,https://ip:80,默认账号密码 ...
- ng + zorro angular表格横纵向合并,横向目前是手动,纵向是自动合并,微调后可适配三大框架使用
表格横纵向合并,可以看一下代码编写之前和之后的样式,先上图~~ 表格页面文件.html <h1>正常表格</h1> <nz-table #colSpanTable [nz ...
- angular8实现前端携带cookie发送给后端+nodejs获取前端发送的cookie
1.前端测试代码angular8 // 测试代码 testCookie() { const url = 'http://10.11.11.11:3000/test/cookie' const para ...
- 为什么游戏公司应该选择 Cloud Spanner 来支持他们的游戏?
普华永道最近的一份报告指出,全球游戏行业是过去几年经历显着增长的行业之一,到 2026 年该行业(不包括电子竞技)的价值有望达到 3210 亿美元.过去仅三年时间,该行业就增加了 5 亿玩家,全球玩家 ...
- 六、python基础知识之变量常量、索引取值和PEP8规范
目录 一.变量与常量 1.什么是变量? 2.什么是常量? 变量的基本使用 变量使用的语法结构与底层原理 变量名的命名规范和命名风格 变量的命名风格 常量的基本使用 二.索引取值 三.PEP8规范 1. ...
- 计算机网络14 Internet网络层主要功能 IP协议 路由协议 ICMP协议
1 主机.路由器网络层主要功能 2 IP数据报 2.1 图示 2.2 字段详细介绍 1)版本号 占4位:IP协议的版本号.4表示IPv4,6表示IPv6. 2)首部长度 占4位:表示IP分组首部长度. ...
- spring cloud alibaba - Nacos 作为注册中心基础使用-服务提供者和消费者
1.概况 服务提供者9001和9002,他们是同一个服务,服务消费者83 2.创建服务提供者 9001和9002除了端口是一样的,这里只演示一个 2.1项目结构 2.2依赖 nacos依赖 <d ...
- Kinsoku jikou desu新浪股票接口变动
1.问题原因 新浪股票接口返回如标题所示值:Kinsoku jikou desu! http://hq.sinajs.cn/list=code 新浪股票的接口变动,需要在请求头中添加Referer值. ...
- UBUNTU18.04安装CUDA
1.官方教程https://docs.nvidia.com/cuda/cuda-installation-guide-linux/index.html#ubuntu-installation 2.在h ...