nightwatchJS ---element用法
2024-08-29 08:18:37
.element()
Search for an element on the page, starting from the document root. The located element will be returned as a WebElement JSON object.
First argument to be passed is the locator strategy, which is detailed on the WebDriver docs.
Parameters:
Name | Type | description |
---|---|---|
using |
string | The locator strategy to use. |
value |
string | The search target. |
callback |
function | Callback function which is called with the result value. |
Usage:
module.exports = {
'demo Test' : function(browser) {
browser.element('css selector', 'body', function(res) {
console.log(res)
});
}
};
示例:
client.element('css selector','#file_grid > tbody > tr > td > i.publish_file.click_icon',function(result){ if(result.status != -1)
{
//element exist
console.log(result);
client.elementIdClick(result.value.ELEMENT); }
else
{
//element not exist
console.log("no appropriate media file to publish ");
} })
最新文章
- 解剖SQLSERVER 第十二篇 OrcaMDF 行压缩支持(译)
- 一种利用 Cumulative Penalty 训练 L1 正则 Log-linear 模型的随机梯度下降法
- php 获取当前时间
- Codeforce Round #214 Div2
- 慕课网-安卓工程师初养成-4-8 Java循环语句之 do...while
- STL源码分析-AVL树-RB树
- 【BZOJ】【3991】【SDOI2015】寻宝游戏
- 11、NFC技术:NDEF Uri格式解析
- 怎么监视跟踪一个进程(Process)中的MS Unit Test DLL的详细性能(performance)【asp.net C#】
- easyui-dialog里面的东西
- Tomcat启动出现:Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SpringMvc]]解决办法
- [BZOJ 2144]跳跳棋
- PVID和VID彻底研究(上) ——PVID的作用及和VID的区别
- C#字体与Rectangle简单对应关系
- 1047A_Little C Loves 3 I(构造)
- VMware 15 安装 MAC OS 10.13 原版(详细图文教程)
- MVC中使用Web API和EntityFramework
- linux cpu 100% 脚本
- Qt——基本工具的使用
- VC中TRACE ASSERT VERIFY之用法
热门文章
- RobotFramework自动化4-批量操作案例【转载】
- hdu 1558(计算几何+并查集)
- Laravel 5.5 Blade::if 简介
- ubuntu 开启PHP CURL支持
- 解决viewpager+多个fragment+listview,listview展示内容高度不自适应出现多余空白问题
- AC日记——Little Elephant and Array codeforces 221d
- 详解xml
- 洛谷——P2656 采蘑菇
- [TopCoder8600]MagicFingerprint
- 面向对象-QuickHit项目