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的更多相关文章
随机推荐
- ABC238E Range Sums
简要题意 有一个长度为 \(N\) 的序列 \(a\),你知道 \(Q\) 个区间的和.求是否可以知道 \([1,n]\) 的和. \(1 \leq N,Q \leq 2 \times 10^5\) ...
- 个别编程语言在OJ平台上的输入输出方式
OJ 平台输入输出 一. C/ C++ 输入 scanf() gets() getchar() 输出 printf() puts() putchar() C++ cin >> cout & ...
- SpringMVC学习笔记 - 第二章 - SSM整合案例 - 技术整合、统一结果封装、统一异常处理、前后联调、拦截器
[前置内容]Spring 学习笔记全系列传送门: Spring学习笔记 - 第一章 - IoC(控制反转).IoC容器.Bean的实例化与生命周期.DI(依赖注入) Spring学习笔记 - 第二章 ...
- 记一下Go类型转换问题
数值类型间可以相互转换 int<->int64,uint8<->float32,uint64<->float64 字符类型转换也可以 string<-> ...
- 【随笔记】NDK 编译开源库 nghttp2/openssl/curl
工作中有遇到需要使用支持 http2 访问的 https 安全加密的开源库,便于使用 http2 与云端通信,经过调研发现 libcurl 可以满足需求,但是 libcurl 本身也是需要依赖于 ng ...
- 图解B树及C#实现(3)数据的删除
目录 前言 从叶子节点删除数据 从非叶子节点删除数据 提前扩充只有 t-1 的 Item 的节点:维持 B树 平衡的核心算法 从左兄弟节点借用 Item 从右兄弟节点借用 Item 与左兄弟节点或者右 ...
- .NET 6学习笔记(6)——SSL证书的导出和格式转换
除了广阔的互联网,这个世界上还存在很多运行在公司内网的Web Application.假设有团队A提供的网站A,现团队B需要将网站B与之集成.网站A已使用了自签的SSL证书.团队B希望能够导出该SSL ...
- Python openpyxl使用教程
1.安装 openpyxl 组件 pip install openpyxl -i https://mirrors.aliyun.com/pypi/simple/ 新建Excel # coding=ut ...
- 通过URL地址将图片保存到本地
今天一朋友问我如何通过URL地址将图片保存下来. 特地找了些资源,实现了一下代码: using System; using System.Drawing; using System.Drawing.I ...
- EPICS Archiver Appliance的定制部署1
https://blog.csdn.net/weixin_43767046/article/details/112116112 简单部署试了一下之后,又试了下Site specific install ...