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 ...
随机推荐
- SQL Server中JOIN的用法
JOIN 分为:内连接(INNER JOIN).外连接(OUTER JOIN).其中,外连接分为:左外连接(LEFT OUTER JOIN).右外连接(RIGHT OUTER JOIN).全外连接(F ...
- UVA 1589:Xiangqi (模拟 Grade D)
题目: 象棋,黑棋只有将,红棋有帅车马炮.问是否死将. 思路: 对方将四个方向走一步,看看会不会被吃. 代码: 很难看……WA了很多发,还越界等等. #include <cstdio> # ...
- 利用Lambda获取类中属性名称
public class TypeInfoHelper { public static string GetPropertyName<T>(Expression<Func<T, ...
- ubuntu for windows10设置中文
运行 sudo dpkg-reconfigure locales ,第一个界面是选择区域,找到后面的zh_CN.UTF-8 UTF-8,回车确认,第二个界面是选择语言,选择zh_CN.UTF-8,回车 ...
- (转)在Unity3D的网络游戏中实现资源动态加载
原文:http://zijan.iteye.com/blog/911102 用Unity3D制作基于web的网络游戏,不可避免的会用到一个技术-资源动态加载.比如想加载一个大场景的资源,不应该在游戏的 ...
- SQL表操作习题3 11~13题
- 每天一个linux命令8之grep高级篇
1语法 grep -[acinv] '搜索内容串' filename -a 以文本文件方式搜索-c 计算找到的符合行的次数-i 忽略大小写-n 顺便输出行号-v 反向选择,即找 没有搜索字 ...
- Linux下进行Web服务器压力(并发)测试工具http_load、webbench、ab、Siege、autobench简单使用教程(转)
一.http_load 程序非常小,解压后也不到100K http_load以并行复用的方式运行,用以测试web服务器的吞吐量与负载.但是它不同于大多数压力测试工 具,它可以以一个单一的进程运行,一般 ...
- DELPHI7下SUPPEROBJECT遍历子对象的name和value
DELPHI7下SUPPEROBJECT遍历子对象的name和value var ite: TSuperAvlIterator; while ite.MoveNext do begin if ite. ...
- WEB将本地项目添加到git
前提下载好git bush1.找到对应的文件夹git init2.Windows下打开Git Bash$ ssh-keygen -t rsa -C "myaccount@example.co ...