.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 ");
} })

  



最新文章

  1. 解剖SQLSERVER 第十二篇 OrcaMDF 行压缩支持(译)
  2. 一种利用 Cumulative Penalty 训练 L1 正则 Log-linear 模型的随机梯度下降法
  3. php 获取当前时间
  4. Codeforce Round #214 Div2
  5. 慕课网-安卓工程师初养成-4-8 Java循环语句之 do...while
  6. STL源码分析-AVL树-RB树
  7. 【BZOJ】【3991】【SDOI2015】寻宝游戏
  8. 11、NFC技术:NDEF Uri格式解析
  9. 怎么监视跟踪一个进程(Process)中的MS Unit Test DLL的详细性能(performance)【asp.net C#】
  10. easyui-dialog里面的东西
  11. Tomcat启动出现:Failed to start component [StandardEngine[Catalina].StandardHost[localhost].StandardContext[/SpringMvc]]解决办法
  12. [BZOJ 2144]跳跳棋
  13. PVID和VID彻底研究(上) ——PVID的作用及和VID的区别
  14. C#字体与Rectangle简单对应关系
  15. 1047A_Little C Loves 3 I(构造)
  16. VMware 15 安装 MAC OS 10.13 原版(详细图文教程)
  17. MVC中使用Web API和EntityFramework
  18. linux cpu 100% 脚本
  19. Qt——基本工具的使用
  20. VC中TRACE ASSERT VERIFY之用法

热门文章

  1. RobotFramework自动化4-批量操作案例【转载】
  2. hdu 1558(计算几何+并查集)
  3. Laravel 5.5 Blade::if 简介
  4. ubuntu 开启PHP CURL支持
  5. 解决viewpager+多个fragment+listview,listview展示内容高度不自适应出现多余空白问题
  6. AC日记——Little Elephant and Array codeforces 221d
  7. 详解xml
  8. 洛谷——P2656 采蘑菇
  9. [TopCoder8600]MagicFingerprint
  10. 面向对象-QuickHit项目