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 ...
随机推荐
- asp.net core 身份认证/权限管理系统简介及简单案例
如今的网站大多数都离不开账号注册及用户管理,而这些功能就是通常说的身份验证.这些常见功能微软都为我们做了封装,我们只要利用.net core提供的一些工具就可以很方便的搭建适用于大部分应用的权限管理系 ...
- (18)PL/SQL
PL/SQL(Procedure Language/SQL) PL/SQL是Oracle对sql语言的过程化扩展---指在sql命令语言中增加了过程处理语句(如分支.循环等),使sql语言具有过程处理 ...
- 51nod 1087 1 10 100 1000【打表】
题目来源: Ural 1209 基准时间限制:1 秒 空间限制:131072 KB 分值: 5 难度:1级算法题 收藏 关注 1,10,100,1000...组成序列1101001000...,求 ...
- 第一讲work(axe)
1,Dao package com.songyan.Dao; public interface Axe { public void chop(); } package com.songyan.Dao; ...
- SimpleDateFormat格式
SimpleDateFormat函数语法: G 年代标志符 y 年 M 月 d 日 h 时 在上午或下午 (1~12) H 时 在一天中 (0~23) m 分 ...
- 任务驱动,学习.NET开发系列第2篇------单词统计
一 高效学习编程的办法 1 任务驱动方式学习软件开发 大部分人学习软件开发技术是通过看书,看视频,听老师上课的方式.这些方式有一个共同点即按知识点进行讲解.比如拿c#编程为例,首先是讲解大量的基础概念 ...
- Using ASIHTTPRequest in an iOS project
1) Add the files Copy the files you need to your project folder, and add them to your Xcode project. ...
- 【maven】maven的web项目打包报错:No compiler is provided in this environment. Perhaps you are running on a JRE rather than a JDK
打包过程中报错如下: No compiler is provided in this environment. Perhaps you are running on a JRE rather than ...
- telnet 查看端口是否可访问
1. 首先为什么要写这篇文章 说到为什么还得从DNS服务器说起.我在我的电脑上安装了DNS服务器,但是用网络去访问还怎么都访问都不上去.于是我就打开dos窗口,用ping命令查看是否可以ping( ...
- Http标准协议Android网络框架——NoHttp
NoHttp详细文档:http://doc.nohttp.net NoHttp公益测试接口:http://api.nohttp.net 支持与RxJava完美结合.支持一句话切换底层为OkHttp,支 ...