当前位置:网站首页>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博客
边栏推荐
- Typical applications of minimum spanning tree
- What kind of experience is it when the Institute earns 20000 yuan a month!
- Audio and video technology development weekly | 232
- Graduation summary
- Class summation, shortest row
- Value transfer communication between components (parent to child, child to parent, brother component to value)
- Eh, the log time of MySQL server is less than 8h?
- What are the virtual machine software? What are their respective functions?
- @Scheduled scheduled tasks
- Aperçu du code source futur - série juc
猜你喜欢
What is the difference between enterprise wechat applet and wechat applet
深度优先搜索简要讲解(附带基础题)
1289_FreeRTOS中vTaskSuspend()接口实现分析
Third party login initial version
Katalon framework test web (XXVI) automatic email
@Scheduled scheduled tasks
Introduction to asynchronous task capability of function calculation - task trigger de duplication
GUI Graphical user interface programming (XIV) optionmenu - what do you want your girlfriend to wear on Valentine's day
Add token validation in swagger
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
随机推荐
PostgreSQL users cannot create table configurations by themselves
【读书会第十三期】视频文件的封装格式
Leetcode51.n queen
JVM family -- monitoring tools
[source code analysis] model parallel distributed training Megatron (5) -- pipestream flush
[paddleseg source code reading] paddleseg calculates Miou
what does ctrl + d do?
MySQL is dirty
Objective-C description method and type method
ctf-pikachu-CSRF
三年进账35.31亿,这个江西老表要IPO了
选择排序与冒泡排序模板
Tcpclientdemo for TCP protocol interaction
Learning video website
pytest多进程/多线程执行测试用例
JDBC 进阶
Pandora IOT development board learning (HAL Library) - Experiment 6 independent watchdog experiment (learning notes)
[.NET + mqtt]. Mise en œuvre de la communication mqtt dans l'environnement net 6 et démonstration de code pour l'abonnement et la publication de messages bilatéraux du serveur et du client
毕业总结
Wechat official account web page authorization