1.本脚本是去除确定键弹窗
katalon没有办法处理错误,利用js的try函数就可以
//Add Extension Scripts加载扩展脚本,关闭katalon,刷新页面再打开
Selenium.prototype.doRemovesure = function(){
try{
document.getElementsByClassName('button primary ensure-button')[2].click();
document.getElementsByClassName('button larger')[0].click();
}
catch(err){
}
//document.getElementsByClassName('bg s_btn').click();
}
2.参数写法
//产生随机数
Selenium.prototype.doStoreRandom = function(variableName){
random = Math.floor(Math.random()*10000000);
storedVars[variableName] = random;
}
注意:网上其他人的写法只有两条命令,但是katalon需要storeEval命令来重新激活参数的值