tag:blogger.com,1999:blog-2973787519736718861.post5415909850079393354..comments2024-03-13T05:54:14.145-07:00Comments on Software testing tutorials and automation: Example of "while" and "endWhile" Loop Commands In Selenium IDE With Use Of User ExtensionUnknownnoreply@blogger.comBlogger22125tag:blogger.com,1999:blog-2973787519736718861.post-7400456237353801202016-11-02T18:18:05.868-07:002016-11-02T18:18:05.868-07:00how do I loop through items in a list? For example...how do I loop through items in a list? For example, when loop through loading a site and filling out a form, and read one of the fields into the form from a list of values. Does that make sense?Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-10452800841911950312016-04-07T07:14:55.388-07:002016-04-07T07:14:55.388-07:00plz tell me how make a report in selenium ide???plz tell me how make a report in selenium ide???Anonymoushttps://www.blogger.com/profile/05118082760629109820noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-52378781828360816862016-04-07T07:11:26.819-07:002016-04-07T07:11:26.819-07:00plz tell me how to prepare documentation in seleni...plz tell me how to prepare documentation in selenium ide????Anonymoushttps://www.blogger.com/profile/05118082760629109820noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-90683275258173710102015-12-09T01:07:21.668-08:002015-12-09T01:07:21.668-08:00how to loop between the test cases..?that means tr...how to loop between the test cases..?that means transfer control from one test case to anotherAnonymoushttps://www.blogger.com/profile/15610955186463197947noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-14775139591111089922015-12-09T01:06:37.317-08:002015-12-09T01:06:37.317-08:00how to loop between the test cases..?...that means...how to loop between the test cases..?...that means transfer control from one test case to another..Anonymoushttps://www.blogger.com/profile/15610955186463197947noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-72957232139871559162015-07-29T08:38:59.592-07:002015-07-29T08:38:59.592-07:00For selenium RC, you need to use while loop of lan...For selenium RC, you need to use while loop of language which you are using.Aravindhttps://www.blogger.com/profile/14277419258196682147noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-73949054431760781062015-07-28T20:48:29.575-07:002015-07-28T20:48:29.575-07:00Above code works in Selenium IDE but not in Seleni...Above code works in Selenium IDE but not in Selenium RC. Please help me. Thanks.Anonymoushttps://www.blogger.com/profile/04995610313842067523noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-37506892723340829932014-06-13T00:02:37.202-07:002014-06-13T00:02:37.202-07:00The loops works perfectly. But how can I continue ...The loops works perfectly. But how can I continue with the next case after the loop ends ?<br /><br />I just want to loop a few cases within my test suite.Anonymoushttps://www.blogger.com/profile/12571066072778147209noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-46000769665130016942014-06-03T03:23:04.165-07:002014-06-03T03:23:04.165-07:00Can you help me ?
When i used while command.
i got...Can you help me ?<br />When i used while command.<br />i got error ... unknown command :"while"Anonymoushttps://www.blogger.com/profile/14762092805341202853noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-18945193378787927292014-05-29T11:26:17.624-07:002014-05-29T11:26:17.624-07:00I actually figured out why this doesn't work f...I actually figured out why this doesn't work for some and does for others. The problem is when you copy and paste the Target values.<br /><br />For example on the store javascript{storedVars.MyVar++;} value if you copy and paste a blank space into any of these values it will loop forever because variable name is not the same.<br /><br />Please trim all your spaces and this will workAnonymoushttps://www.blogger.com/profile/17155918797896166530noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-83096899302376349872014-03-28T02:34:45.806-07:002014-03-28T02:34:45.806-07:00the above example doesn't work.
i'm using ...the above example doesn't work.<br />i'm using IDE 2.5.0 and have included your user-extension.js<br /><br />this did work:<br /><br />store | 1 | MyVar<br />while | storedVars.MyVar <=10<br />echo | ${MyVar}<br />highlight | id=menu1<br />storeEval | parseInt(storedVars.MyVar) +1 | MyVar<br />endWhileAnonymoushttps://www.blogger.com/profile/12200040258120476338noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-70397642928829500112014-02-08T03:08:00.734-08:002014-02-08T03:08:00.734-08:00var gotoLabels= {};
var whileLabels = {};
// over...var gotoLabels= {};<br />var whileLabels = {};<br /><br />// overload the original Selenium reset function<br />Selenium.prototype.reset = function() {<br /> // reset the labels<br /> this.initialiseLabels();<br /> // proceed with original reset code<br /> this.defaultTimeout = Selenium.DEFAULT_TIMEOUT;<br /> this.browserbot.selectWindow("null");<br /> this.browserbot.resetPopups();<br />}<br /><br />Selenium.prototype.initialiseLabels = function()<br />{<br /> gotoLabels = {};<br /> whileLabels = { ends: {}, whiles: {} };<br /> var command_rows = [];<br /> var numCommands = testCase.commands.length;<br /> for (var i = 0; i < numCommands; ++i) {<br /> var x = testCase.commands[i];<br /> command_rows.push(x);<br /> }<br /> var cycles = [];<br /> for( var i = 0; i < command_rows.length; i++ ) {<br /> if (command_rows[i].type == 'command')<br /> switch( command_rows[i].command.toLowerCase() ) {<br /> case "label":<br /> gotoLabels[ command_rows[i].target ] = i;<br /> break;<br /> case "while":<br /> case "endwhile":<br /> cycles.push( [command_rows[i].command.toLowerCase(), i] )<br /> break;<br /> }<br /> } <br /> var i = 0;<br /> while( cycles.length ) {<br /> if( i >= cycles.length ) {<br /> throw new Error( "non-matching while/endWhile found" );<br /> }<br /> switch( cycles[i][0] ) {<br /> case "while":<br /> if( ( i+1 < cycles.length ) && ( "endwhile" == cycles[i+1][0] ) ) {<br /> // pair found<br /> whileLabels.ends[ cycles[i+1][1] ] = cycles[i][1];<br /> whileLabels.whiles[ cycles[i][1] ] = cycles[i+1][1];<br /> cycles.splice( i, 2 );<br /> i = 0;<br /> } else ++i;<br /> break;<br /> case "endwhile":<br /> ++i;<br /> break;<br /> }<br /> }<br />}<br /><br />Selenium.prototype.continueFromRow = function( row_num )<br />{<br /> if(row_num == undefined || row_num == null || row_num < 0) {<br /> throw new Error( "Invalid row_num specified." );<br /> }<br /> testCase.debugContext.debugIndex = row_num;<br />}<br /><br />// do nothing. simple label<br />Selenium.prototype.doLabel = function(){};<br /><br />Selenium.prototype.doGotolabel = function( label )<br />{<br /> if( undefined == gotoLabels[label] ) {<br /> throw new Error( "Specified label '" + label + "' is not found." );<br /> }<br /> this.continueFromRow( gotoLabels[ label ] );<br />};<br /><br />Selenium.prototype.doGoto = Selenium.prototype.doGotolabel;<br /><br />Selenium.prototype.doGotoIf = function( condition, label )<br />{<br /> if( eval(condition) ) this.doGotolabel( label );<br />}<br /><br />Selenium.prototype.doWhile = function( condition )<br />{<br /> if( !eval(condition) ) {<br /> var last_row = testCase.debugContext.debugIndex;<br /> var end_while_row = whileLabels.whiles[ last_row ];<br /> if( undefined == end_while_row ) throw new Error( "Corresponding 'endWhile' is not found." );<br /> this.continueFromRow( end_while_row );<br /> }<br />}<br /><br />Selenium.prototype.doEndWhile = function()<br />{<br /> var last_row = testCase.debugContext.debugIndex;<br /> var while_row = whileLabels.ends[ last_row ] - 1;<br /> if( undefined == while_row ) throw new Error( "Corresponding 'While' is not found." );<br /> this.continueFromRow( while_row );<br />}<br />Anonymoushttps://www.blogger.com/profile/11678863282233664154noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-91169093407370730382013-12-18T15:15:22.622-08:002013-12-18T15:15:22.622-08:00[error] Unexpected Exception: SyntaxError: syntax ...[error] Unexpected Exception: SyntaxError: syntax error. fileName -> chrome://selenium-ide/content/tools.js -> file:///C:/My_docs/CRM_New/user-extension.js?1387406453042, lineNumber -> 91, columnNumber -> 0SSKhttps://www.blogger.com/profile/08430924072623995839noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-44445002849559275922013-12-10T17:31:39.687-08:002013-12-10T17:31:39.687-08:00same error ::::::::::::::::::::::::::::::
[error] ...same error ::::::::::::::::::::::::::::::<br />[error] Unexpected Exception: TypeError: testCase.debugContext.currentCommand() is undefined. fileName -> chrome://selenium-ide/content/selenium-runner.js, lineNumber -> 242Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-22359710269661487922013-11-21T06:27:25.498-08:002013-11-21T06:27:25.498-08:00I downloaded your user script as well as your roll...I downloaded your user script as well as your rollup script. Then I created a while/endWhile script and turned it into a rollup. This worked fine. Then I created a second while/endWhile script and rolled that up too. Now I get an error when playing the first while/endWhile rollup in a test script. I am using Selenium IDE 2.4.0. See error below.<br /><br />[error] testCase.debugContext.currentCommand(...) is undefined<br />[error] Unexpected Exception: TypeError: testCase.debugContext.currentCommand(...) is undefined. fileName -> chrome://selenium-ide/content/selenium-runner.js, lineNumber -> 242, columnNumber -> 6Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-34401659329066872642013-10-03T19:47:05.461-07:002013-10-03T19:47:05.461-07:00Its working for me. I think you have not configure...Its working for me. I think you have not configured properly.Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-56150742617548936552013-09-30T06:35:59.183-07:002013-09-30T06:35:59.183-07:00I have run this script but not working properly. I...I have run this script but not working properly. I have save the js file and restart the selenium also.Narendra Singh Kushwahhttps://www.blogger.com/profile/10934929464696008163noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-91557322471691885862013-08-10T00:17:58.848-07:002013-08-10T00:17:58.848-07:00Your email id is not valid. It shows me message &q...Your email id is not valid. It shows me message "Delivery to the following recipient failed permanently" when trying to send email. Please give me other id if you have.Aravindhttps://www.blogger.com/profile/14277419258196682147noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-17086586911446927482013-08-09T18:28:06.300-07:002013-08-09T18:28:06.300-07:00Give me your email id here. Let me send to script ...Give me your email id here. Let me send to script for you.Aravindhttps://www.blogger.com/profile/14277419258196682147noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-9768462283161799122013-08-09T05:55:37.078-07:002013-08-09T05:55:37.078-07:00While and End while not here in Selenium Ide comma...While and End while not here in Selenium Ide command.please check and explain.<br />I have run this script but not working properly. I have save the js file and restart the selenium also.<br />Anonymousnoreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-74753127039346516652013-08-01T09:31:35.428-07:002013-08-01T09:31:35.428-07:00You can use "gotoif" command to jump at ...You can use "gotoif" command to jump at the end of script when your condition match. You can see how to use "gotoif" command with selenium IDE at http://software-testing-tutorials-automation.blogspot.in/search/label/gotoIf%20CommandAravindhttps://www.blogger.com/profile/14277419258196682147noreply@blogger.comtag:blogger.com,1999:blog-2973787519736718861.post-31909116679704348542013-08-01T05:27:53.788-07:002013-08-01T05:27:53.788-07:00Can you please tell me how to break while loop in ...Can you please tell me how to break while loop in selenium ide?<br /><br />Something like EXIT or BREAK.<br /><br />Thanks<br /><br />KashyapAnonymousnoreply@blogger.com