当前位置:网站首页>Katalon使用script实现查询List大小
Katalon使用script实现查询List大小
2022-07-04 03:47:00 【春天的菠菜】
背景:自动化场景当中存在表格对象的位置是动态的,如果依据动态来获取呢,下图例子当中是对象位置在最后一个位置,所以我只要知道这一组元素对象大小即可。如果位置在其他,可以考虑适应循环来查询,欢迎关注交流
import com.kms.katalon.core.webui.driver.DriverFactory as DriverFactory
import org.openqa.selenium.WebDriver as Webdriver
import org.openqa.selenium.By as By
import org.openqa.selenium.WebElement as WebElement
'获取driver'
Webdriver driver = DriverFactory.getWebDriver()
'查找一组元素对象'
List elementsList_P = driver.findElements(By.xpath('//*tr/th/div'))
'这个只要查询操作在哪列'
int col_num = elementsList_P.size()
'这个就可以作为参数去引用了,例如XPATH'
println('总列长:' + col_num)
在XPATH参照Katalon中控件的参数化_春天的菠菜的博客-CSDN博客
边栏推荐
- Mitsubishi M70 macro variable reading Mitsubishi M80 public variable acquisition Mitsubishi CNC variable reading acquisition Mitsubishi CNC remote tool compensation Mitsubishi machine tool online tool
- What kind of experience is it when the Institute earns 20000 yuan a month!
- A review of reverse reinforcement learning at Virginia Tech (VT)
- Monitoring - Prometheus introduction
- CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
- Easy to win insert sort
- 渗透实战-guest账户-mimikatz-向日葵-sql提权-离线解密
- what does ctrl + d do?
- Jenkins configures IP address access
- Class summation, shortest row
猜你喜欢
'2'>' 10'==true? How does JS perform implicit type conversion?
ctf-pikachu-CSRF
Penetration practice - sqlserver empowerment
Is it really so difficult to learn redis? Today, a fan will share his personal learning materials!
Mitsubishi M70 macro variable reading Mitsubishi M80 public variable acquisition Mitsubishi CNC variable reading acquisition Mitsubishi CNC remote tool compensation Mitsubishi machine tool online tool
MySQL data query optimization -- data structure of index
functools下的reduce函数
How about the ratings of 2022 Spring Festival Gala in all provinces? Map analysis helps you show clearly!
[latex] production of complex tables: excel2latex and detail adjustment
Defensive programming skills
随机推荐
CesiumJS 2022^ 源码解读[0] - 文章目录与源码工程结构
MySQL data query optimization -- data structure of index
MySQL maxscale realizes read-write separation
Object oriented -- encapsulation, inheritance, polymorphism
Katalon framework test web (XXVI) automatic email
Reduce function under functools
STM32外接DHT11显示温湿度
Select sorting and bubble sorting template
Add token validation in swagger
Redis notes (I) Linux installation process of redis
Leecode 122. Zuijia timing of buying and selling stocks ②
Support the first triggered go ticker
Consul of distributed service registration discovery and unified configuration management
Aperçu du code source futur - série juc
Summary of Chinese remainder theorem
PostgreSQL users cannot create table configurations by themselves
CSP drawing
Tcpclientdemo for TCP protocol interaction
What are the virtual machine software? What are their respective functions?
拼夕夕二面:说说布隆过滤器与布谷鸟过滤器?应用场景?我懵了。。