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的更多相关文章
随机推荐
- linux 基础之输入输出重定向
输入输出重定向 输出重定向 正确命令 > 文件 (覆盖) 正确命令 >> 文件(追加) 错误命令 2> 文件(覆盖) 错误命令 2>>文件(追加) 命令> 文 ...
- Three.js 进阶之旅:新春特典-Rabbit craft go 🐇
声明:本文涉及图文和模型素材仅用于个人学习.研究和欣赏,请勿二次修改.非法传播.转载.出版.商用.及进行其他获利行为. 摘要 兔年到了,祝大家身体健,康万事顺利.本文内容作为兔年新春纪念页面,将使用 ...
- angular11给Echarts添加点击事件,无脑抄代码的时候到了~~ 超好用
关于引入Echarts的方法在此 直通车在此 接下来就是添加点击事件,获取X轴的数据 <div echarts #charts [options]="chartOption" ...
- OpenStack命令行参考
OpenStack命令行参考 hello,大家好,这里是费冰.在使用OpenStack的过程中,固然我们可以通过 web 页面完成绝大多数的操作,但作为管理人员,不能不知晓 OpenStack 命令行 ...
- Pycharm中图标的含义
Pycharm中图标的含义 问题 有同学问,下面的v,c,f等都是啥意思 这个问题嘛,应该在python学习阶段来问,不过我也只能解释部分,有些也只能靠猜测 按图索骥找了下pycharm的官网doc, ...
- LeetCode_806. 写字符串需要的行数
题目 难度:简单 原文:https://leetcode-cn.com/problems/number-of-lines-to-write-string/ 题目 我们要把给定的字符串 S 从左到右写到 ...
- 《自定义工作流配置,springboot集成activiti,前端vue,完整版审批单据》
前言 activiti工作流引擎项目,企业erp.oa.hr.crm等企事业办公系统轻松落地,一套完整并且实际运用在多套项目中的案例,满足日常业务流程审批需求. 一.项目形式 springboot+v ...
- Java编译异常捕捉与上报笔记
异常处理机制的作用:增强程序的健壮性 处理编译异常方式一: 在方法声明位置上使用throws关键字抛出,谁调用该方法,就交给谁处理 注意:为Exception的是需要处理的,否则编译器会报错,可以一直 ...
- 4 .NET Core笔试题
1.说说.NET7中 _ViewImports文件的作用? 2.什么是Razor页面? 3.说说.NET5中 __ViewStart文件的作用? 4.如何在Razor页面中实现数据模型绑定? 5.如何 ...
- aspnetcore 原生 DI 实现基于 key 的服务获取
你可能想通过一个字符串或者其他的类型来获取一个具体的服务实现,那么在 aspnetcore 原生的 MSDI 中,如何实现呢?本文将介绍如何通过自定义工厂来实现. 我们现在恰好有基于 Json 和 M ...