Iterating elements using NightWatchJS
1) used the following strategy to iterate over DOM elements using Nightwatch:
// Executing a function in the application context.
client.execute(function () { // Get elements by CSS selector.
var elements = document.querySelectorAll('.elements'); // Iterate over them.
[].forEach.call(elements, function (element) { // Manipulate each element.
element.click();
});
});
2) the number returned by allitems.value[0].ELEMENT
will work as the id.
3) jQuery 定位
$('#padt_lic_numb > ul > li > label').each(function(){ $(this).click(); });
4) nightwatchjs
client.elements("css selector","#padt_lic_numb > ul > li > label",function(results)
{
results.value.forEach(function(index){
// console.log('Element value is '+index.ELEMENT);
client.elementIdText(index.ELEMENT,function(result){
//console.log(result.value);
if(result.value == plate_number)
{
console.log(result.value);
console.log(plate_number);
client.elementIdClick(index.ELEMENT);
}
});
})
});
Iterating elements using NightWatchJS的更多相关文章
- js Form.elements[i]的使用实例
function pdf(){ //一个html里面可能存在多个form,所以document.form[0]指的是第一个form,document.form[1]返回就是第二个form,如果没 ...
- View and Data API Tips: Hide elements in viewer completely
By Daniel Du With View and Data API, you can hide some elements in viewer by calling "viewer.hi ...
- [LeetCode] Minimum Moves to Equal Array Elements II 最少移动次数使数组元素相等之二
Given a non-empty integer array, find the minimum number of moves required to make all array element ...
- [LeetCode] Minimum Moves to Equal Array Elements 最少移动次数使数组元素相等
Given a non-empty integer array of size n, find the minimum number of moves required to make all arr ...
- [LeetCode] Top K Frequent Elements 前K个高频元素
Given a non-empty array of integers, return the k most frequent elements. For example,Given [1,1,1,2 ...
- [LeetCode] Remove Linked List Elements 移除链表元素
Remove all elements from a linked list of integers that have value val. Example Given: 1 --> 2 -- ...
- Chrome 开发工具之Elements
友情提示:全文图片高能,如使用手机阅读,请确保在wifi情况下或者流量充足.图片有点渣,也算辛苦做出来的,请别嫌弃- Elements面板主要展示当前页面的组织结构,在如今的应用程序中,HTML页面初 ...
- T-SQL Recipes之Separating elements
Separating elements Separating elements is a classic T-SQL challenge. It involves a table called Arr ...
- POJ2167Irrelevant Elements[唯一分解定理 组合数 杨辉三角]
Irrelevant Elements Time Limit: 5000MS Memory Limit: 65536K Total Submissions: 2407 Accepted: 59 ...
随机推荐
- 使用bottle进行web开发(3):静态文件的获取
静态文件(比如css啊,需要下载的各位文件等),需要通过static_file来操作,首先记得要在import中导入 @route('/static/<filename>') def se ...
- tf一些理解(根据资料)
首先看了开源操作机器人系统-ros这本书(张建伟)第五章slam导航 5.1使用tf配置机器人 还有ros navigation 教程 http://wiki.ros.org/navigation/T ...
- VirtualBox虚拟机安装CentOS 7
新建虚拟机 因为比较简单,所以对于VirtualBox就不做过多介绍了,直接下载安装即可,安装好之后打开Oracle VM VirtualBox管理器,点击新建,选择Red Hat(根据windows ...
- Linux操作常识
1.分区 linux如果手动选择分区,必须的两个分区是根分区和swap分区,swap分区是与内存的交换分区,通常设置大小为内存的两倍(如果内存够大也可以不用设置) 2.关机重启 命令:shu ...
- yii2 ftp 的常规操作 上传 下载
<?php function make_directory($ftp_stream, $dir){ // if directory already exists or can be immedi ...
- 牛客网 暑期ACM多校训练营(第二场)J.farm-STL(vector)+二维树状数组区间更新、单点查询 or 大暴力?
开心.jpg J.farm 先解释一下题意,题意就是一个n*m的矩形区域,每个点代表一个植物,然后不同的植物对应不同的适合的肥料k,如果植物被撒上不适合的肥料就会死掉.然后题目将每个点适合的肥料种类( ...
- kuangbin系列【简单搜索】
poj-1321棋盘问题[bfs/回溯] Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 36385 Accepted: ...
- IO模型同步与异步阻塞与非阻塞的区别
同步异步的区别 关注点:同步和异步关注的是消息通信机制 同步:所谓同步,就是在发出一个*调用*时,在没有得到结果之前,该*调用*就不返回.但是一旦调用返回,就得到返回值了.换句话说,就是由*调用者*主 ...
- linux tail指令
http://www.cnblogs.com/peida/archive/2012/11/07/2758084.html tail -f file, check the log file tail ...
- java 的""和null的区别
null和""的区别 问题一: null和""的区别 String s=null; string.trim()就会抛出为空的exception String s ...