首页 > Web开发 > 详细

点击含下拉菜单的列表/表单按钮:通过JS创建虚拟按钮并点击

时间:2015-02-27 18:21:14      阅读:455      评论:0      收藏:0      [点我收藏+]

${JsCode} | Get Element Attribute | XPATH=//table[@class=‘mnubar‘]//tr//td//span[text()=‘${MenuArr[0]}‘ and @class=‘mnuBtn‘]/parent::span/table[@class=‘mnuList‘]//tr/td[text()=‘${MenuArr[1]}‘]/parent::tr@action

注释:

1、MenuArr为传入的需要点击的按钮路径,如:新增/报价单

2、将对应按钮路径的@action属性的JS传给${JsCode},便于下面点击虚拟按钮时调用该JS动作。

3、action属性值:if (_iLocked<=0) {_lock();try{openAddWin(‘报价单);} catch(e){} finally{_unlock();}}

 

Execute Javascript | var button=window.document.getElementById(‘rfs_Button‘);if(button)window.document.body.removeChild(button);

Execute Javascript | var button=document.createElement(‘input‘);button.type=‘button‘;button.id=‘rfs_Button‘;button.value=‘RFS_Button‘;button.onclick=function(){${JsCode}};window.document.body.insertBefore(button, window.document.body.firstChild);

click button | rfs_Button

点击含下拉菜单的列表/表单按钮:通过JS创建虚拟按钮并点击

原文:http://www.cnblogs.com/BIGMOM/p/4303917.html

(0)
(0)
   
举报
评论 一句话评论(0
关于我们 - 联系我们 - 留言反馈 - 联系我们:wmxa8@hotmail.com
© 2014 bubuko.com 版权所有
打开技术之扣,分享程序人生!