-
Notifications
You must be signed in to change notification settings - Fork 7
/
user-extensions-min.js
1 lines (1 loc) · 41.2 KB
/
user-extensions-min.js
1
var selblocks={name:"selblocks",seleniumEnv:"ide",globalContext:this};(function(a){a.fn={};a.unwrapObject=function(b){if(typeof(b)==="undefined"||b==null){return b}if(b.wrappedJSObject){return b.wrappedJSObject}return b};a.fmtCmd=function(b){var d=b.command;if(b.target){d+="|"+b.target}if(b.value){d+="|"+b.value}return d}}(selblocks));(function(b){function a(){this.error=function(c){this.logit("error",c)};this.warn=function(c){this.logit("warn",c)};this.info=function(c){this.logit("info",c)};this.debug=function(c){this.logit("debug",c)};this.trace=function(c){this.logit("debug",c)};this.logit=function(c,d){LOG[c]("["+b.name+"] "+d)};this.genStackTrace=function(h){var j=h||new Error();var c=[];if(!j.stack){c.push("No stack trace, (Firefox only)")}else{var g=/^\s*[A-Za-z0-9\-_\$]+\(/;var d=j.stack.split("\n");for(var f=0;f<d.length;f++){if(d[f].match(g)){c.push(d[f])}}if(!h){c.shift()}}return c};this.logStackTrace=function(e){var d=this.genStackTrace(e);if(!e){d.shift()}this.warn("__Stack Trace__");for(var c=0;c<d.length;c++){this.warn("@@ "+d[c])}};this.descCaller=function(){var c=this.genStackTrace(new Error());if(c.length==0){return"no client function"}c.shift();if(c.length==0){return"no caller function"}c.shift();if(c.length==0){return"undefined caller function"}return"caller: "+c[0]}}b.LOG=new a()}(selblocks));(function(a){a.InfixExpressionParser={_objname:"InfixExpressionParser",BRACKET_PAIRS:{"(":")","{":"}","[":"]"},trimListValues:true,splitList:function(g,f){var b=[];var c=0,e=0;while(e<g.length){if(g.charAt(e)!=f){e=this.spanSub(g,e);if(e==-1){throw new Error("Unbalanced expression grouping at: "+g.substr(c))}}else{var d=g.substring(c,e);if(this.trimListValues){d=d.trim()}b.push(d);c=e+1}e++}b.push(g.substring(c));if(b.length==1&&b[0].trim()==""){b.length=0}return b},spanTo:function(d,b,c){while(d.charAt(b)!=c){b=this.spanSub(d,b);if(b==-1||b>=d.length){return -1}b++}return b},spanSub:function(c,b){if(b<c.length){if(c.charAt(b)=="("){return this.spanTo(c,b+1,")")}else{if(c.charAt(b)=="["){return this.spanTo(c,b+1,"]")}else{if(c.charAt(b)=="{"){return this.spanTo(c,b+1,"}")}else{if(c.charAt(b)=="'"){return c.indexOf("'",b+1)}else{if(c.charAt(b)=='"'){return c.indexOf('"',b+1)}}}}}}return b},formatList:function(j,b,h,g,e){var c="";for(var d=0;d<b.length;d++){var f=((g)?g(b[d],d):b[d]);if(c){c+=j||" "}if(h){c+=h}if(f){c+=f}if(e){c+=e}}return c}}}(selblocks));(function(a){a.fn.interceptBefore=function(c,e,d){var b=c[e];c[e]=function(){d.call(this);return b.call(this)}};a.fn.interceptAfter=function(c,e,d){var b=c[e];c[e]=function(){var f=Array.prototype.slice.call(arguments);b.apply(this,f);return d.apply(this,f)}};a.fn.interceptReplace=function(b,d,c){b[d]=function(){return c.call(this)}};a.fn.interceptStack=[];a.fn.interceptPush=function(c,f,b,e){var d={targetObj:c,targetFnName:f,savedFn:c[f],attrs:e};a.fn.interceptStack.push(d);c[f]=b};a.fn.interceptPop=function(){var b=a.fn.interceptStack.pop();b.targetObj[b.targetFnName]=b.savedFn};a.fn.getInterceptTop=function(){return a.fn.interceptStack[a.fn.interceptStack.length-1]};a.fn.interceptOnce=function(b,d,c){a.fn.interceptPush(b,d,function(){a.fn.interceptPop();var e=Array.prototype.slice.call(arguments);c.apply(this,e)})}}(selblocks));(function(a){a.seleniumEnv="server";a.globalContext.serverPatchApplied=a.globalContext.serverPatchApplied||false;if(!a.globalContext.serverPatchApplied){a.LOG.info("Applying testCase server patch for "+a.name);a.fn.interceptAfter(Selenium.prototype,"reset",b);a.globalContext.serverPatchApplied=true}function b(){if(!(typeof htmlTestRunner==="undefined"||htmlTestRunner===null)){htmlTestRunner.currentTest.commands=c(htmlTestRunner.currentTest.htmlTestCase.getCommandRows());a.globalContext.testCase=htmlTestRunner.currentTest;a.globalContext.testCase.debugContext=htmlTestRunner.currentTest;Object.defineProperties(a.globalContext.testCase,{_nextCommandRowIndex:{writable:true},debugIndex:{enumerable:true,get:function(){return this._nextCommandRowIndex},set:function(e){this._nextCommandRowIndex=e}},nextCommandRowIndex:{enumerable:true,get:function(){return this._nextCommandRowIndex},set:function(e){this._nextCommandRowIndex=e}}})}function c(g){var e=[];for(var f=0;f<g.length;++f){e.push(d(g[f]))}return e}function d(f){var e=f.getCommand();if(f.hasOwnProperty("trElement")){e.type="command"}else{e.type="comment"}return e}}}(selblocks));function $e(a){return selblocks.unwrapObject(selenium.browserbot.findElementOrNull(a))}function $x(c,b,a){var e=selenium.browserbot.getDocument();var d;if(a){d=selblocks.xp.selectNode(e,c,b,a)}else{d=selblocks.xp.selectElement(e,c,b)}return d}function $X(d,b,a){var e=selenium.browserbot.getDocument();var c;if(a){c=selblocks.xp.selectNodes(e,d,b,a)}else{c=selblocks.xp.selectElements(e,d,b)}return c}(function($$){String.prototype.isOneOf=function(valuesObj){var values=valuesObj;if(!(values instanceof Array)){values=Array.prototype.slice.call(arguments)}var i;for(i=0;i<this.length;i++){if(values[i]==this){return true}}return false};String.prototype.mapTo=function(){var errMsg=" The map function requires pairs of argument: string, array";assert(arguments.length%2===0,errMsg+"; found "+arguments.length);var i;for(i=0;i<arguments.length;i+=2){assert((typeof arguments[i].toLowerCase()==="string")&&(arguments[i+1] instanceof Array),errMsg+"; found "+typeof arguments[i]+", "+typeof arguments[i+1]);if(this.isOneOf(arguments[i+1])){return arguments[i]}}return this};String.prototype.translate=function(t1,t2){assert(t1.constructor===t2.constructor,"translate() function requires arrays of the same type");assert(t1.length===t2.length,"translate() function requires arrays of equal size");var i;if(t1.constructor===String){var buf="";for(i=0;i<this.length;i++){var c=this.substr(i,1);var t;for(t=0;t<t1.length;t++){if(c===t1.substr(t,1)){c=t2.substr(t,1);break}}buf+=c}return buf}if(t1.constructor===Array){for(i=0;i<t1.length;i++){if(t1[i]==this){return t2[i]}}}else{assert(false,"translate() function requires arguments of type String or Array")}return null};var symbols={};var blockDefs=null;var callStack=null;function idxHere(){return testCase.debugContext.debugIndex}function BlockDefs(){var blkDefs=[];blkDefs.init=function(i,attrs){blkDefs[i]=attrs||{};blkDefs[i].idx=i;blkDefs[i].cmdName=testCase.commands[i].command;return blkDefs[i]};return blkDefs}function blkDefAt(idx){return blockDefs[idx]}function blkDefHere(){return blkDefAt(idxHere())}function blkDefFor(stackFrame){if(!stackFrame){return null}return blkDefAt(stackFrame.idx)}function Stack(){var stack=[];stack.isEmpty=function(){return stack.length===0};stack.top=function(){return stack[stack.length-1]};stack.findEnclosing=function(_hasCriteria){return stack[stack.indexWhere(_hasCriteria)]};stack.indexWhere=function(_hasCriteria){var i;for(i=stack.length-1;i>=0;i--){if(_hasCriteria(stack[i])){return i}}};stack.unwindTo=function(_hasCriteria){if(stack.length===0){return null}while(!_hasCriteria(stack.top())){stack.pop()}return stack.top()};stack.isHere=function(){return(stack.length>0&&stack.top().idx===idxHere())};return stack}Stack.isTryBlock=function(stackFrame){return(blkDefFor(stackFrame).nature==="try")};Stack.isLoopBlock=function(stackFrame){return(blkDefFor(stackFrame).nature==="loop")};Stack.isFunctionBlock=function(stackFrame){return(blkDefFor(stackFrame).nature==="function")};var branchIdx=null;function nextCommand(){if(!this.started){this.started=true;this.debugIndex=testCase.startPoint?testCase.commands.indexOf(testCase.startPoint):0}else{if(branchIdx!==null){$$.LOG.info("branch => "+fmtCmdRef(branchIdx));this.debugIndex=branchIdx;branchIdx=null}else{this.debugIndex++}}while(this.debugIndex<testCase.commands.length){if($$.seleniumEnv=="server"){this._advanceToNextRow();if(this.currentRow==null){return null}}var command=testCase.commands[this.debugIndex];if(command.type==="command"){this.runTimeStamp=Date.now();return command}this.debugIndex++}return null}function setNextCommand(cmdIdx){assert(cmdIdx>=0&&cmdIdx<testCase.commands.length," Cannot branch to non-existent command @"+(cmdIdx+1));branchIdx=cmdIdx}$$.fn.interceptAfter(Selenium.prototype,"reset",function(){$$.LOG.trace("In tail intercept :: Selenium.reset()");$$.seleniumTestRunner=($$.seleniumEnv=="server")?htmlTestRunner:editor.selDebugger.runner;try{compileSelBlocks()}catch(err){notifyFatalErr("In "+err.fileName+" @"+err.lineNumber+": "+err)}callStack=new Stack();callStack.push({blockStack:new Stack()});$$.tcf={nestingLevel:-1};$$.LOG.debug("Configuring tail intercept: testCase.debugContext.nextCommand()");$$.fn.interceptReplace(testCase.debugContext,"nextCommand",nextCommand)});function activeBlockStack(){return callStack.top().blockStack}function compileSelBlocks(){blockDefs=new BlockDefs();var lexStack=new Stack();var i;for(i=0;i<testCase.commands.length;i++){if(testCase.commands[i].type==="command"){var curCmd=testCase.commands[i].command;var aw=curCmd.indexOf("AndWait");if(aw!==-1){curCmd=curCmd.substring(0,aw)}var cmdTarget=testCase.commands[i].target;var ifDef;var tryDef;var expectedCmd;switch(curCmd){case"label":assertNotAndWaitSuffix(i);symbols[cmdTarget]=i;break;case"goto":case"gotoIf":case"skipNext":assertNotAndWaitSuffix(i);break;case"if":assertNotAndWaitSuffix(i);lexStack.push(blockDefs.init(i,{nature:"if",elseIfIdxs:[]}));break;case"elseIf":assertNotAndWaitSuffix(i);assertBlockIsPending("elseIf",i,", is not valid outside of an if/endIf block");ifDef=lexStack.top();assertMatching(ifDef.cmdName,"if",i,ifDef.idx);var eIdx=blkDefFor(ifDef).elseIdx;if(eIdx){notifyFatal(fmtCmdRef(eIdx)+" An else has to come after all elseIfs.")}blockDefs.init(i,{ifIdx:ifDef.idx});blkDefFor(ifDef).elseIfIdxs.push(i);break;case"else":assertNotAndWaitSuffix(i);assertBlockIsPending("if",i,", is not valid outside of an if/endIf block");ifDef=lexStack.top();assertMatching(ifDef.cmdName,"if",i,ifDef.idx);if(blkDefFor(ifDef).elseIdx){notifyFatal(fmtCmdRef(i)+" There can only be one else associated with a given if.")}blockDefs.init(i,{ifIdx:ifDef.idx});blkDefFor(ifDef).elseIdx=i;break;case"endIf":assertNotAndWaitSuffix(i);assertBlockIsPending("if",i);ifDef=lexStack.pop();assertMatching(ifDef.cmdName,"if",i,ifDef.idx);blockDefs.init(i,{ifIdx:ifDef.idx});blkDefFor(ifDef).endIdx=i;if(ifDef.elseIdx){blkDefAt(ifDef.elseIdx).endIdx=i}break;case"try":assertNotAndWaitSuffix(i);lexStack.push(blockDefs.init(i,{nature:"try",name:cmdTarget}));break;case"catch":assertNotAndWaitSuffix(i);assertBlockIsPending("try",i,", is not valid without a try block");tryDef=lexStack.top();assertMatching(tryDef.cmdName,"try",i,tryDef.idx);if(blkDefFor(tryDef).catchIdx){notifyFatal(fmtCmdRef(i)+" There can only be one catch-block associated with a given try.")}var fIdx=blkDefFor(tryDef).finallyIdx;if(fIdx){notifyFatal(fmtCmdRef(fIdx)+" A finally-block has to be last in a try section.")}blockDefs.init(i,{tryIdx:tryDef.idx});blkDefFor(tryDef).catchIdx=i;break;case"finally":assertNotAndWaitSuffix(i);assertBlockIsPending("try",i);tryDef=lexStack.top();assertMatching(tryDef.cmdName,"try",i,tryDef.idx);if(blkDefFor(tryDef).finallyIdx){notifyFatal(fmtCmdRef(i)+" There can only be one finally-block associated with a given try.")}blockDefs.init(i,{tryIdx:tryDef.idx});blkDefFor(tryDef).finallyIdx=i;if(tryDef.catchIdx){blkDefAt(tryDef.catchIdx).finallyIdx=i}break;case"endTry":assertNotAndWaitSuffix(i);assertBlockIsPending("try",i);tryDef=lexStack.pop();assertMatching(tryDef.cmdName,"try",i,tryDef.idx);if(cmdTarget){assertMatching(tryDef.name,cmdTarget,i,tryDef.idx)}blockDefs.init(i,{tryIdx:tryDef.idx});blkDefFor(tryDef).endIdx=i;if(tryDef.catchIdx){blkDefAt(tryDef.catchIdx).endIdx=i}break;case"while":case"for":case"foreach":case"forJson":case"forXml":assertNotAndWaitSuffix(i);lexStack.push(blockDefs.init(i,{nature:"loop"}));break;case"continue":case"break":assertNotAndWaitSuffix(i);assertCmd(i,lexStack.findEnclosing(Stack.isLoopBlock),", is not valid outside of a loop");blockDefs.init(i,{beginIdx:lexStack.top().idx});break;case"endWhile":case"endFor":case"endForeach":case"endForJson":case"endForXml":assertNotAndWaitSuffix(i);expectedCmd=curCmd.substr(3).toLowerCase();assertBlockIsPending(expectedCmd,i);var beginDef=lexStack.pop();assertMatching(beginDef.cmdName.toLowerCase(),expectedCmd,i,beginDef.idx);blkDefFor(beginDef).endIdx=i;blockDefs.init(i,{beginIdx:beginDef.idx});break;case"loadJsonVars":case"loadXmlVars":assertNotAndWaitSuffix(i);break;case"call":assertNotAndWaitSuffix(i);blockDefs.init(i);break;case"function":case"script":assertNotAndWaitSuffix(i);symbols[cmdTarget]=i;lexStack.push(blockDefs.init(i,{nature:"function",name:cmdTarget}));break;case"return":assertNotAndWaitSuffix(i);assertBlockIsPending("function",i,", is not valid outside of a function/endFunction block");var funcCmd=lexStack.findEnclosing(Stack.isFunctionBlock);blockDefs.init(i,{funcIdx:funcCmd.idx});break;case"endFunction":case"endScript":assertNotAndWaitSuffix(i);expectedCmd=curCmd.substr(3).toLowerCase();assertBlockIsPending(expectedCmd,i);var funcDef=lexStack.pop();assertMatching(funcDef.cmdName.toLowerCase(),expectedCmd,i,funcDef.idx);if(cmdTarget){assertMatching(funcDef.name,cmdTarget,i,funcDef.idx)}blkDefFor(funcDef).endIdx=i;blockDefs.init(i,{funcIdx:funcDef.idx});break;case"exitTest":assertNotAndWaitSuffix(i);break;default:}}}if(!lexStack.isEmpty()){var cmdErrors=[];while(!lexStack.isEmpty()){var pend=lexStack.pop();cmdErrors.unshift(fmtCmdRef(pend.idx)+" without a terminating 'end"+pend.cmdName.substr(0,1).toUpperCase()+pend.cmdName.substr(1)+"'")}throw new SyntaxError(cmdErrors.join("; "))}function assertNotAndWaitSuffix(cmdIdx){assertCmd(cmdIdx,(testCase.commands[cmdIdx].command.indexOf("AndWait")===-1),", AndWait suffix is not valid for SelBlocks commands")}function assertBlockIsPending(expectedCmd,cmdIdx,desc){assertCmd(cmdIdx,!lexStack.isEmpty(),desc||", without an beginning ["+expectedCmd+"]")}function assertMatching(curCmd,expectedCmd,cmdIdx,pendIdx){assertCmd(cmdIdx,curCmd===expectedCmd,", does not match command "+fmtCmdRef(pendIdx))}}function assertIntraBlockJumpRestriction(fromIdx,toIdx){var fromRange=findBlockRange(fromIdx);var toRange=findBlockRange(toIdx);if(fromRange||toRange){var msg=" Attempt to jump";if(fromRange){msg+=" out of "+fromRange.desc+fromRange.fmt()}if(toRange){msg+=" into "+toRange.desc+toRange.fmt()}assert(fromRange&&fromRange.equals(toRange),msg+". You cannot jump into, or out of: loops, functions, or try blocks.")}}function findBlockRange(locusIdx){var idx;for(idx=locusIdx-1;idx>=0;idx--){var blk=blkDefAt(idx);if(blk){if(locusIdx>blk.endIdx){continue}switch(blk.nature){case"loop":return new CmdRange(blk.idx,blk.endIdx,blk.cmdName+" loop");case"function":return new CmdRange(blk.idx,blk.endIdx,"function '"+blk.name+"'");case"try":return isolateTcfRange(locusIdx,blk)}}}}function isolateTcfRange(idx,tryDef){var RANGES=[{ifr:tryDef.finallyIdx,ito:tryDef.endIdx,desc:"finally",desc2:"end"},{ifr:tryDef.catchIdx,ito:tryDef.finallyIdx,desc:"catch",desc2:"finally"},{ifr:tryDef.catchIdx,ito:tryDef.endIdx,desc:"catch",desc2:"end"},{ifr:tryDef.idx,ito:tryDef.catchIdx,desc:"try",desc2:"catch"},{ifr:tryDef.idx,ito:tryDef.finallyIdx,desc:"try",desc2:"finally"},{ifr:tryDef.idx,ito:tryDef.endIdx,desc:"try",desc2:"end"}];var i;for(i=0;i<RANGES.length;i++){var rng=RANGES[i];if(rng.ifr<=idx&&idx<rng.ito){var desc=rng.desc+"-block";if(rng.desc!=="try"){desc+=" for"}if(tryDef.name){desc+=" '"+tryDef.name+"'"}return new CmdRange(rng.ifr,rng.ito,desc)}}}function CmdRange(topIdx,bottomIdx,desc){this.topIdx=topIdx;this.bottomIdx=bottomIdx;this.desc=desc;this.equals=function(cmdRange){return(cmdRange&&cmdRange.topIdx===this.topIdx&&cmdRange.bottomIdx===this.bottomIdx)};this.fmt=function(){return" @["+(this.topIdx+1)+"-"+(this.bottomIdx+1)+"]"}}var iexpr=Object.create($$.InfixExpressionParser);function validateNames(names,desc){var i;for(i=0;i<names.length;i++){validateName(names[i],desc)}}function validateName(name,desc){var match=name.match(/^[a-zA-Z]\w*$/);if(!match){notifyFatal("Invalid character(s) in "+desc+" name: '"+name+"'")}}Selenium.prototype.doLabel=function(){};Selenium.prototype.doSkipNext=function(spec){assertRunning();var n=parseInt($$.evalWithVars(spec),10);if(isNaN(n)){if(spec.trim()===""){n=1}else{notifyFatalHere(" Requires a numeric value")}}else{if(n<0){notifyFatalHere(" Requires a number > 1")}}if(n!==0){destIdx=idxHere()+n+1;assertIntraBlockJumpRestriction(idxHere(),destIdx);setNextCommand(destIdx)}};Selenium.prototype.doGoto=function(label){assertRunning();assert(symbols[label]!==undefined," Target label '"+label+"' is not found.");assertIntraBlockJumpRestriction(idxHere(),symbols[label]);setNextCommand(symbols[label])};Selenium.prototype.doGotoIf=function(condExpr,label){assertRunning();if($$.evalWithVars(condExpr)){this.doGoto(label)}};Selenium.prototype.doIf=function(condExpr,locator){assertRunning();var ifDef=blkDefHere();var ifState={idx:idxHere(),elseIfItr:arrayIterator(ifDef.elseIfIdxs)};activeBlockStack().push(ifState);cascadeElseIf(ifState,condExpr)};Selenium.prototype.doElseIf=function(condExpr){assertRunning();assertActiveScope(blkDefHere().ifIdx);var ifState=activeBlockStack().top();if(ifState.skipElseBlocks){setNextCommand(blkDefAt(blkDefHere().ifIdx).endIdx)}else{cascadeElseIf(ifState,condExpr)}};Selenium.prototype.doElse=function(){assertRunning();assertActiveScope(blkDefHere().ifIdx);var ifState=activeBlockStack().top();if(ifState.skipElseBlocks){setNextCommand(blkDefHere().endIdx)}};Selenium.prototype.doEndIf=function(){assertRunning();assertActiveScope(blkDefHere().ifIdx);activeBlockStack().pop()};function cascadeElseIf(ifState,condExpr){assertCompilable("",condExpr,";","Invalid condition");if(!$$.evalWithVars(condExpr)){var ifDef=blkDefFor(ifState);if(ifState.elseIfItr.hasNext()){setNextCommand(ifState.elseIfItr.next())}else{if(ifDef.elseIdx){setNextCommand(ifDef.elseIdx)}else{setNextCommand(ifDef.endIdx)}}}else{ifState.skipElseBlocks=true}}Selenium.prototype.doThrow=function(err){err=$$.evalWithVars(err);if(!(err instanceof Error)){err=new SelblocksError(idxHere(),err)}throw err};Selenium.prototype.doTry=function(tryName){assertRunning();var tryState={idx:idxHere(),name:tryName};activeBlockStack().push(tryState);var tryDef=blkDefHere();if(!tryDef.catchIdx&&!tryDef.finallyIdx){$$.LOG.warn(fmtCurCmd()+" does not have a catch-block nor a finally-block, and therefore serves no purpose");if($$.tcf.nestingLevel===-1){return}}if(tryDef.catchIdx){var errDcl=testCase.commands[tryDef.catchIdx].target;$$.LOG.debug(tryName+" catchable: "+(errDcl||"ANY"))}$$.tcf.nestingLevel++;tryState.execPhase="trying";if($$.tcf.nestingLevel===0){$$.fn.interceptPush($$.seleniumTestRunner.currentTest,"resume",$$.handleAsTryBlock,{manageError:handleCommandError})}$$.LOG.debug("++ try nesting: "+$$.tcf.nestingLevel)};Selenium.prototype.doCatch=function(){assertRunning();assertActiveScope(blkDefHere().tryIdx);var tryState=activeBlockStack().top();if(tryState.execPhase!=="catching"){var tryDef=blkDefFor(tryState);if(tryDef.finallyIdx){setNextCommand(tryDef.finallyIdx)}else{setNextCommand(tryDef.endIdx)}}$$.LOG.debug("entering catch block")};Selenium.prototype.doFinally=function(){assertRunning();assertActiveScope(blkDefHere().tryIdx);delete storedVars._error;$$.LOG.debug("entering finally block")};Selenium.prototype.doEndTry=function(tryName){assertRunning();assertActiveScope(blkDefHere().tryIdx);delete storedVars._error;var tryState=activeBlockStack().pop();if(tryState.execPhase){$$.tcf.nestingLevel--;$$.LOG.debug("-- try nesting: "+$$.tcf.nestingLevel);if($$.tcf.nestingLevel<0){$$.fn.interceptPop()}if($$.tcf.bubbling){reBubble()}else{$$.LOG.debug("no bubbling in process")}}var tryDef=blkDefFor(tryState);$$.LOG.debug("end of try '"+tryDef.name+"'")};function handleCommandError(err){var tryState=bubbleToTryBlock(Stack.isTryBlock);var tryDef=blkDefFor(tryState);if(tryState){$$.LOG.debug("error encountered while: "+tryState.execPhase);if(hasUnspentCatch(tryState)){if(isMatchingCatch(err,tryDef.catchIdx)){$$.LOG.info("@"+(idxHere()+1)+", error has been caught"+fmtCatching(tryState));tryState.hasCaught=true;tryState.execPhase="catching";storedVars._error=err;$$.tcf.bubbling=null;setNextCommand(tryDef.catchIdx);return true}}}$$.LOG.debug("error not caught, bubbling error: '"+err.message+"'");$$.tcf.bubbling={mode:"error",error:err,srcIdx:idxHere()};if(hasUnspentFinally(tryState)){$$.LOG.info("Bubbling suspended while finally block runs");tryState.execPhase="finallying";tryState.hasFinaled=true;setNextCommand(tryDef.finallyIdx);return true}if($$.tcf.nestingLevel>0){$$.LOG.info("No further handling, error bubbling will continue outside of this try.");setNextCommand(tryDef.endIdx);return true}$$.LOG.info("No handling provided in this try section for this error: '"+err.message+"'");return false}function bubbleCommand(cmdIdx,_isContextBlockType){var tryState=bubbleToTryBlock(isTryWithMatchingOrFinally);var tryDef=blkDefFor(tryState);$$.tcf.bubbling={mode:"command",srcIdx:cmdIdx,_isStopCriteria:_isContextBlockType};if(hasUnspentFinally(tryState)){$$.LOG.info("Command "+fmtCmdRef(cmdIdx)+", suspended while finally block runs");tryState.execPhase="finallying";tryState.hasFinaled=true;setNextCommand(tryDef.finallyIdx)}else{$$.LOG.info("No further handling, bubbling continuing outside of this try.");setNextCommand(tryDef.endIdx)}function isTryWithMatchingOrFinally(stackFrame){if(_isContextBlockType&&_isContextBlockType(stackFrame)){return true}if($$.tcf.bubbling&&$$.tcf.bubbling.mode==="error"&&hasUnspentCatch(stackFrame)){var tryDef=blkDefFor(stackFrame);if(isMatchingCatch($$.tcf.bubbling.error,tryDef.catchIdx)){return true}}return hasUnspentFinally(stackFrame)}}function isMatchingCatch(e,catchIdx){var errDcl=testCase.commands[catchIdx].target;if(!errDcl){return true}var errExpr=$$.evalWithVars(errDcl);var errMsg=e.message;if(errExpr instanceof RegExp){return(errMsg.match(errExpr))}return(errMsg.indexOf(errExpr)!==-1)}function bubbleToTryBlock(_hasCriteria){if($$.tcf.nestingLevel<0){$$.LOG.warn("bubbleToTryBlock() called outside of any try nesting")}var tryState=unwindToBlock(_hasCriteria);while(!tryState&&$$.tcf.nestingLevel>-1&&callStack.length>1){var callFrame=callStack.pop();$$.LOG.info("function '"+callFrame.name+"' aborting due to error");restoreVarState(callFrame.savedVars);tryState=unwindToBlock(_hasCriteria)}return tryState}function unwindToBlock(_hasCriteria){var tryState=activeBlockStack().unwindTo(_hasCriteria);if(tryState){$$.LOG.debug("unwound to: "+fmtTry(tryState))}return tryState}function reBubble(){if($$.tcf.bubbling.mode==="error"){if($$.tcf.nestingLevel>-1){$$.LOG.debug("error-bubbling continuing...");handleCommandError($$.tcf.bubbling.error)}else{$$.LOG.error("Error was not caught: '"+$$.tcf.bubbling.error.message+"'");try{throw $$.tcf.bubbling.error}finally{$$.tcf.bubbling=null}}}else{if(isBubblable()){$$.LOG.debug("command-bubbling continuing...");bubbleCommand($$.tcf.bubbling.srcIdx,$$.tcf.bubbling._isStopCriteria)}else{$$.LOG.info("command-bubbling complete - suspended command executing now "+fmtCmdRef($$.tcf.bubbling.srcIdx));setNextCommand($$.tcf.bubbling.srcIdx);$$.tcf.bubbling=null}}}function transitionBubbling(_isContextBlockType){if($$.tcf.bubbling){if($$.tcf.bubbling.mode==="error"){$$.LOG.debug("Bubbling error: '"+$$.tcf.bubbling.error.message+"', replaced with command "+fmtCmdRef(idxHere()));$$.tcf.bubbling={mode:"command",srcIdx:idxHere(),_isStopCriteria:_isContextBlockType};return true}$$.LOG.debug("Command suspension "+fmtCmdRef($$.tcf.bubbling.srcIdx)+", replaced with "+fmtCmdRef(idxHere()));$$.tcf.bubbling.srcIdx=idxHere();return true}if(isBubblable(_isContextBlockType)){bubbleCommand(idxHere(),_isContextBlockType);return true}return false}function isBubblable(_isContextBlockType){var canBubble=($$.tcf.nestingLevel>-1);if(canBubble){var blkState=activeBlockStack().findEnclosing(isTryOrContextBlockType);return(blkDefFor(blkState).nature==="try")}return canBubble;function isTryOrContextBlockType(stackFrame){if(_isContextBlockType&&_isContextBlockType(stackFrame)){return true}return Stack.isTryBlock(stackFrame)}}function hasUnspentCatch(tryState){return(tryState&&blkDefFor(tryState).catchIdx&&!tryState.hasCaught)}function hasUnspentFinally(tryState){return(tryState&&blkDefFor(tryState).finallyIdx&&!tryState.hasFinaled)}function fmtTry(tryState){var tryDef=blkDefFor(tryState);return((tryDef.name?"try '"+tryDef.name+"' ":"")+"@"+(tryState.idx+1)+", "+tryState.execPhase+".. "+$$.tcf.nestingLevel+"n")}function fmtCatching(tryState){if(!tryState){return""}var bbl="";if($$.tcf.bubbling){bbl="@"+($$.tcf.bubbling.srcIdx+1)+" "}var tryDef=blkDefFor(tryState);var catchDcl=testCase.commands[tryDef.catchIdx].target;return" :: "+bbl+catchDcl}Selenium.prototype.doWhile=function(condExpr){enterLoop(function(){assert(condExpr," 'while' requires a condition expression.");assertCompilable("",condExpr,";","Invalid condition");return null},function(){},function(){return($$.evalWithVars(condExpr))},function(){})};Selenium.prototype.doEndWhile=function(){iterateLoop()};Selenium.prototype.doFor=function(forSpec){enterLoop(function(loop){assert(forSpec," 'for' requires: <initial-val>; <condition>; <iter-stmt>.");assertCompilable("for ( ",forSpec," );","Invalid loop parameters");var specs=iexpr.splitList(forSpec,";");assert(specs.length===3," 'for' requires <init-stmt>; <condition>; <iter-stmt>.");loop.initStmt=specs[0];loop.condExpr=specs[1];loop.iterStmt=specs[2];var localVarNames=parseVarNames(loop.initStmt);$$.LOG.debug("localVarNames: "+localVarNames.join(","));validateNames(localVarNames,"variable");return localVarNames},function(loop){$$.evalWithVars(loop.initStmt)},function(loop){return($$.evalWithVars(loop.condExpr))},function(loop){$$.evalWithVars(loop.iterStmt)})};Selenium.prototype.doEndFor=function(){iterateLoop()};function parseVarNames(initStmt){var varNames=[];if(initStmt){var vInits=iexpr.splitList(initStmt,",");var i;for(i=0;i<vInits.length;i++){var vInit=iexpr.splitList(vInits[i],"=");varNames.push(vInit[0])}}return varNames}Selenium.prototype.doForeach=function(varName,valueExpr){enterLoop(function(loop){assert(varName," 'foreach' requires a variable name.");assert(valueExpr," 'foreach' requires comma-separated values.");assertCompilable("[ ",valueExpr," ];","Invalid value list");loop.values=$$.evalWithVars("["+valueExpr+"]");if(loop.values.length===1&&loop.values[0] instanceof Array){loop.values=loop.values[0]}return[varName,"_i"]},function(loop){loop.i=0;storedVars[varName]=loop.values[loop.i]},function(loop){storedVars._i=loop.i;return(loop.i<loop.values.length)},function(loop){if(++(loop.i)<loop.values.length){storedVars[varName]=loop.values[loop.i]}})};Selenium.prototype.doEndForeach=function(){iterateLoop()};Selenium.prototype.doLoadJsonVars=function(filepath,selector){assert(filepath," Requires a JSON file path or URL.");var jsonReader=new $$.fn.JSONReader(filepath);loadVars(jsonReader,"JSON object",filepath,selector)};Selenium.prototype.doLoadXmlVars=function(filepath,selector){assert(filepath," Requires an XML file path or URL.");var xmlReader=new $$.fn.XmlReader(filepath);loadVars(xmlReader,"XML element",filepath,selector)};Selenium.prototype.doLoadVars=function(filepath,selector){$$.LOG.warn("The loadVars command has been deprecated as of SelBlocks 2.0.2 and will be removed in future releases. Please use loadXmlVars instead.");Selenium.prototype.doLoadXmlVars(filepath,selector)};function loadVars(reader,desc,filepath,selector){if(selector){assertCompilable("",selector,";","Invalid selector condition")}reader.load(filepath);reader.next();if(!selector&&!reader.EOF()){notifyFatalHere(" Multiple "+desc+"s are not valid for this command. (A specific "+desc+' can be selected by specifying: name="value".)')}var result=$$.evalWithVars(selector);if(typeof result!=="boolean"){notifyFatalHere(", "+selector+" is not a boolean expression")}var isEof=reader.EOF();while(!isEof&&$$.evalWithVars(selector)!==true){reader.next();isEof=reader.EOF()}if(!$$.evalWithVars(selector)){notifyFatalHere(desc+" not found for selector expression: "+selector+"; in input file "+filepath)}}Selenium.prototype.doForJson=function(jsonpath){enterLoop(function(loop){assert(jsonpath," Requires a JSON file path or URL.");loop.jsonReader=new $$.fn.JSONReader();var localVarNames=loop.jsonReader.load(jsonpath);return localVarNames},function(){},function(loop){var isEof=loop.jsonReader.EOF();if(!isEof){loop.jsonReader.next()}return !isEof},function(){})};Selenium.prototype.doEndForJson=function(){iterateLoop()};Selenium.prototype.doForXml=function(xmlpath){enterLoop(function(loop){assert(xmlpath," 'forXml' requires an XML file path or URL.");loop.xmlReader=new $$.fn.XmlReader();var localVarNames=loop.xmlReader.load(xmlpath);return localVarNames},function(){},function(loop){var isEof=loop.xmlReader.EOF();if(!isEof){loop.xmlReader.next()}return !isEof},function(){})};Selenium.prototype.doEndForXml=function(){iterateLoop()};function enterLoop(_validateFunc,_initFunc,_condFunc,_iterFunc){assertRunning();var loopState;if(!activeBlockStack().isHere()){loopState={idx:idxHere()};activeBlockStack().push(loopState);var localVars=_validateFunc(loopState);loopState.savedVars=getVarState(localVars);initVarState(localVars);_initFunc(loopState)}else{loopState=activeBlockStack().top();_iterFunc(loopState)}if(!_condFunc(loopState)){loopState.isComplete=true;setNextCommand(blkDefHere().endIdx)}}function iterateLoop(){assertRunning();assertActiveScope(blkDefHere().beginIdx);var loopState=activeBlockStack().top();if(loopState.isComplete){restoreVarState(loopState.savedVars);activeBlockStack().pop()}else{setNextCommand(blkDefHere().beginIdx)}}Selenium.prototype.doContinue=function(condExpr){var loopState=dropToLoop(condExpr);if(loopState){var endCmd=blkDefFor(loopState);setNextCommand(blkDefAt(endCmd.endIdx).beginIdx)}};Selenium.prototype.doBreak=function(condExpr){var loopState=dropToLoop(condExpr);if(loopState){loopState.isComplete=true;setNextCommand(blkDefFor(loopState).endIdx)}};function dropToLoop(condExpr){assertRunning();if(condExpr){assertCompilable("",condExpr,";","Invalid condition")}if(transitionBubbling(Stack.isLoopBlock)){return}if(condExpr&&!$$.evalWithVars(condExpr)){return}var loopState=activeBlockStack().unwindTo(Stack.isLoopBlock);return loopState}Selenium.prototype.doCall=function(funcName,argSpec){assertRunning();if(argSpec){assertCompilable("var ",argSpec,";","Invalid call parameter(s)")}var funcIdx=symbols[funcName];assert(funcIdx!==undefined," Function does not exist: "+funcName+".");var activeCallFrame=callStack.top();if(activeCallFrame.isReturning&&activeCallFrame.returnIdx===idxHere()){restoreVarState(callStack.pop().savedVars)}else{var args=parseArgs(argSpec);var savedVars=getVarStateFor(args);setVars(args);callStack.push({funcIdx:funcIdx,name:funcName,args:args,returnIdx:idxHere(),savedVars:savedVars,blockStack:new Stack()});setNextCommand(funcIdx)}};Selenium.prototype.doFunction=function(funcName){assertRunning();var funcDef=blkDefHere();var activeCallFrame=callStack.top();if(activeCallFrame.funcIdx===idxHere()){setVars(activeCallFrame.args)}else{setNextCommand(funcDef.endIdx)}};Selenium.prototype.doScript=function(scrName){$$.LOG.warn("The script command has been deprecated as of SelBlocks 2.0 and will be removed in future releases. Please use function instead.");Selenium.prototype.doFunction(scrName)};Selenium.prototype.doReturn=function(value){returnFromFunction(null,value)};Selenium.prototype.doEndFunction=function(funcName){returnFromFunction(funcName)};Selenium.prototype.doEndScript=function(scrName){returnFromFunction(scrName)};function returnFromFunction(funcName,returnVal){assertRunning();if(transitionBubbling(Stack.isFunctionBlock)){return}var endDef=blkDefHere();var activeCallFrame=callStack.top();if(activeCallFrame.funcIdx!==endDef.funcIdx){}else{if(returnVal){storedVars._result=$$.evalWithVars(returnVal)}activeCallFrame.isReturning=true;setNextCommand(activeCallFrame.returnIdx)}}Selenium.prototype.doExitTest=function(){if(transitionBubbling()){return}$$.fn.interceptOnce($$.seleniumTestRunner.currentTest,"resume",$$.handleAsExitTest)};function parseArgs(argSpec){var args={};var parms=iexpr.splitList(argSpec,",");var i;for(i=0;i<parms.length;i++){var keyValue=iexpr.splitList(parms[i],"=");validateName(keyValue[0],"parameter");args[keyValue[0]]=$$.evalWithVars(keyValue[1])}return args}function initVarState(names){if(names){var i;for(i=0;i<names.length;i++){if(!storedVars[names[i]]){storedVars[names[i]]=null}}}}function getVarStateFor(args){var savedVars={};var varname;for(varname in args){savedVars[varname]=storedVars[varname]}return savedVars}function getVarState(names){var savedVars={};if(names){var i;for(i=0;i<names.length;i++){savedVars[names[i]]=storedVars[names[i]]}}return savedVars}function setVars(args){var varname;for(varname in args){storedVars[varname]=args[varname]}}function restoreVarState(savedVars){var varname;for(varname in savedVars){if(savedVars[varname]===undefined){delete storedVars[varname]}else{storedVars[varname]=savedVars[varname]}}}function SelblocksError(idx,message){this.name="SelblocksError";this.message=(message||"");this.idx=idx}SelblocksError.prototype=Error.prototype;function notifyFatalErr(msg,err){$$.LOG.error("Error "+msg);$$.LOG.logStackTrace(err);throw err}function notifyFatal(msg){var err=new Error(msg);$$.LOG.error("Error "+msg);$$.LOG.logStackTrace(err);throw err}function notifyFatalCmdRef(idx,msg){notifyFatal(fmtCmdRef(idx)+msg)}function notifyFatalHere(msg){notifyFatal(fmtCurCmd()+msg)}function assertCmd(idx,cond,msg){if(!cond){notifyFatalCmdRef(idx,msg)}}function assert(cond,msg){if(!cond){notifyFatalHere(msg)}}function assertRunning(){assert(testCase.debugContext.started," Command is only valid in a running script, i.e., cannot be executed via double-click, or via 'Execute this command'.")}function assertActiveScope(expectedIdx){var activeIdx=activeBlockStack().top().idx;assert(activeIdx===expectedIdx," unexpected command, active command was "+fmtCmdRef(activeIdx))}function assertCompilable(left,stmt,right,explanation){try{$$.evalWithVars("function selblocksTemp() { "+left+stmt+right+" }")}catch(e){throw new SyntaxError(fmtCmdRef(idxHere())+" "+explanation+" '"+stmt+"': "+e.message)}}function fmtCurCmd(){return fmtCmdRef(idxHere())}function fmtCmdRef(idx){return("@"+(idx+1)+": ["+$$.fmtCmd(testCase.commands[idx])+"]")}$$.evalWithVars=function(expr){var result=null;try{result=eval("with (storedVars) {"+expr+"}")}catch(e){notifyFatalErr(" While evaluating Javascript expression: "+expr,e)}return result};function IntervalTimer(msDuration){this.msStart=+new Date();this.getElapsed=function(){return(+new Date()-this.msStart)};this.hasExpired=function(){return(msDuration&&this.getElapsed()>msDuration)};this.reset=function(){this.msStart=+new Date()}}function arrayIterator(arrayObject){return new function(ary){var cur=0;this.hasNext=function(){return(cur<ary.length)};this.next=function(){if(this.hasNext()){return ary[cur++]}}}(arrayObject)}}(selblocks));(function(a){a.fn.XmlReader=function(){var h=null;var e=null;var l=null;var k=0;this.load=function(o){var n=b(o,"text/xml");var m=n.responseXML;h=m.getElementsByTagName("vars");if(h===null||h.length===0){throw new Error("A <vars> element could not be loaded, or <testdata> was empty.")}l=0;e=j(h[0]);return e};this.EOF=function(){return(l===null||l>=h.length)};this.next=function(){if(this.EOF()){a.LOG.error("No more <vars> elements to read after element #"+k);return}k++;a.LOG.debug(k+") "+i(h[l]));var m=g(h[0]);var n=g(h[l]);if(n!==m){throw new Error("Inconsistent <testdata> at <vars> element #"+k+"; expected "+m+" attributes, but found "+n+". Each <vars> element must have the same set of attributes.")}f(h[l]);l++};function j(o){var p=[];var n=o.attributes;var m;for(m=0;m<n.length;m++){p.push(n[m].nodeName)}return p}function g(m){return m.attributes.length}function f(p){var o=p.attributes;var n;for(n=0;n<o.length;n++){var m=o[n];if(null===h[0].getAttribute(m.nodeName)){throw new Error("Inconsistent <testdata> at <vars> element #"+k+"; found attribute "+m.nodeName+", which does not appear in the first <vars> element. Each <vars> element must have the same set of attributes.")}storedVars[m.nodeName]=m.nodeValue}}function i(m){if(XMLSerializer!=="undefined"){return(new XMLSerializer()).serializeToString(m)}if(m.xml){return m.xml}throw"XMLSerializer is not supported or can't serialize "+m}};a.fn.JSONReader=function(){var i=null;var f=null;var l=null;var k=0;this.load=function(o){var n=b(o);var m=n.responseText;m=m.replace(/\0/g,"");if(m.charCodeAt(0)==65533&&m.charCodeAt(1)==65533){m=m.substr(2)}a.LOG.info(m);i=a.evalWithVars(m);if(i===null||i.length===0){throw new Error("A JSON object could not be loaded, or the file was empty.")}l=0;f=j(i[0]);return f};this.EOF=function(){return(l===null||l>=i.length)};this.next=function(){if(this.EOF()){a.LOG.error("No more JSON objects to read after object #"+k);return}k++;a.LOG.debug(k+") "+e(i[l]));var m=h(i[0]);var n=h(i[l]);if(n!==m){throw new Error("Inconsistent JSON object #"+k+"; expected "+m+" attributes, but found "+n+". Each JSON object must have the same set of attributes.")}g(i[l]);l++};function j(n){var o=[];var m;for(m in n){o.push(m)}return o}function h(o){var p=0;var m;for(m in o){p++}return p}function g(n){var m;for(m in n){if(null===i[0][m]){throw new Error("Inconsistent JSON at object #"+k+"; found attribute "+m+", which does not appear in the first JSON object. Each JSON object must have the same set of attributes.")}storedVars[m]=n[m]}}function e(p){if(typeof uneval==="function"){var o=uneval(p);return o.substring(1,o.length-1)}var n="";for(var m in p){n+=" "+m+": "+p[m]}return"{"+n+" }"}};function b(h,i){var f=new d();var e;if(a.seleniumEnv=="ide"){e=c(h)}else{e=h}var g=f.getDocumentSynchronous(e,i);a.LOG.info("Reading from: "+e);return g}function c(j){if(j.indexOf("http")==0){return j}var h="file://";var f=j;if(j.substring(0,h.length).toLowerCase()!==h){var e=testCase.file.path.replace("\\","/","g");var g=e.lastIndexOf("/");f=h+e.substr(0,g)+"/"+j}return f}function d(){}d.prototype.prepareUrl=function(e){var f;if(window.location.href.indexOf("selenium-server")>=0){a.LOG.debug("FileReader() is running in SRC mode");f=e}else{f=absolutify(e,selenium.browserbot.baseUrl)}a.LOG.debug("FileReader() using URL to get file '"+f+"'");return f};d.prototype.getDocumentSynchronous=function(f,j){var g=this.prepareUrl(f);var h=this.newXMLHttpRequest();if(!h){throw new Error("XMLHttp requester object not initialized")}if(j){h.overrideMimeType(j)}h.open("GET",g,false);try{h.send(null)}catch(i){throw new Error("Error while fetching URL '"+g+"':: "+i)}if(h.status!==200&&h.status!==0){throw new Error("Error while fetching "+g+" server response has status = "+h.status+", "+h.statusText)}return h};d.prototype.newXMLHttpRequest=function(){var g=0;try{if(window.ActiveXObject){try{g=new ActiveXObject("Msxml2.XMLHTTP")}catch(f){g=new ActiveXObject("Microsoft.XMLHTTP")}}else{if(window.XMLHttpRequest){g=new XMLHttpRequest()}}}catch(h){throw new Error("Your browser has to support XMLHttpRequest in order to read data files\n"+h)}return g}}(selblocks));(function(a){a.xp={evaluateXpath:function(i,g,e,d,h,c){a.xp.logXpathEval(i,g,e);var f=(c!=null);try{var j=i.evaluate(g,e||i,h,d||XPathResult.ANY_TYPE,c);a.LOG.trace("XPATH Result: "+a.xp.fmtXpathResultType(j)+" : "+g)}catch(b){a.LOG.error("XPATH: "+g);throw b}if(f){j=c}return j},selectElement:function(e,d,b){var c=a.xp.selectElements(e,d,b);return(c&&c.length>0?c[0]:null)},selectElements:function(e,d,b){var c=a.xp.selectNodes(e,d,b);return c},selectNode:function(f,e,d,c){var b=a.xp.evaluateXpath(f,e,d,c||XPathResult.FIRST_ORDERED_NODE_TYPE);return a.unwrapObject(b.singleNodeValue)},selectNodes:function(g,f,d,c){var b=a.xp.evaluateXpath(g,f,d,c||XPathResult.ORDERED_NODE_SNAPSHOT_TYPE);var e=[];a.xp.foreachNode(b,function(j,h){e.push(a.unwrapObject(j))});return e},selectNodeSnapshot:function(d,c,b){return a.xp.evaluateXpath(d,c,b,XPathResult.ORDERED_NODE_SNAPSHOT_TYPE)},selectUniqueNodeNullable:function(d,c,b){var e=a.xp.selectNodeSnapshot(d,c,b);if(!e||e.snapshotLength==0){return null}if(e.snapshotLength>1){a.LOG.debug("Ambiguous: "+e.snapshotLength+" matches");return null}return a.unwrapObject(e.snapshotItem(0))},selectValue:function(f,d,c){var b=a.xp.evaluateXpath(f,d,c,XPathResult.ANY_TYPE);if(!b){return null}var e=null;switch(b.resultType){case b.STRING_TYPE:e=b.stringValue;break;case b.NUMBER_TYPE:e=b.numberValue;break;case b.BOOLEAN_TYPE:e=b.booleanValue;break}return e},foreachNode:function(e,c){if(!e){return}var d=0;var f=e.snapshotItem(d);while(f!=null){var b=c(a.unwrapObject(f),d);if(b==false){return}f=e.snapshotItem(++d)}},fmtXpathResultType:function(b){if(!b){return null}switch(b.resultType){case b.STRING_TYPE:return"'"+b.stringValue+"'";case b.NUMBER_TYPE:return b.numberValue;case b.BOOLEAN_TYPE:return b.booleanValue;case b.ANY_UNORDERED_NODE_TYPE:return"uNODE "+b.singleNodeValue;case b.FIRST_ORDERED_NODE_TYPE:return"oNODE "+b.singleNodeValue;case b.UNORDERED_NODE_SNAPSHOT_TYPE:return b.snapshotLength+" uNODEs";case b.ORDERED_NODE_SNAPSHOT_TYPE:return b.snapshotLength+" oNODEs";case b.UNORDERED_NODE_ITERATOR_TYPE:return"uITR";case b.ORDERED_NODE_ITERATOR_TYPE:return"oITR"}return b},logXpathEval:function(d,c,b){a.LOG.debug("XPATH: "+c);if(b&&b!=d){a.LOG.debug("XPATH Context: "+b)}}}}(selblocks));(function(a){a.handleAsExitTest=function(){try{selenium.browserbot.runScheduledPollers();this.testComplete()}catch(b){this._handleCommandError(b);this.testComplete()}a.LOG.info("TEST HALTED")}}(selblocks));(function(a){a.handleAsTryBlock=function(){try{selenium.browserbot.runScheduledPollers();this._executeCurrentCommand();if(this.result.failed&&b(this.result)){this.continueTest()}else{this.continueTestWhenConditionIsTrue()}}catch(c){if(b(c)){this.continueTest()}else{if(!this._handleCommandError(c)){this.testComplete()}else{this.continueTest()}}}function b(f){var d=a.fn.getInterceptTop();if(f.constructor.name=="AssertResult"){f=new Error(f.failureMessage)}return(d&&d.attrs.manageError(f))}}}(selblocks));