Friday, 10 February 2012

Selenium IDE - parameterization

For parameterization you need to create js file
For eg. Js file contains
  var username=new Array("parameterization1@mailinator.com","parameterization2@mailinator.com");
  var password=new Array("parameterization1","parameterization2");

Sample script for parameterization



17 comments:

  1. I tried above example and added user extensions : data.js and goto_sel_ide.js file for while loop .But the test case doesn't run

    ReplyDelete
  2. Which user extension we should be adding for while loop ?

    ReplyDelete
  3. Are you getting any error??
    The same extension will be used for while loop..

    ReplyDelete
  4. [info] Executing: |store | 0 | looptimes |
    [info] Executing: |while | storedVars.looptimes <=1 | |
    [error] Unknown command: 'while'
    i hanged here, it is not identifying while command, Please help us.

    ReplyDelete
  5. For while command you need extension - goto_sel_ide.js file, you can get it from
    http://wiki.openqa.org/pages/viewpageattachments.action?pageId=379&metadataLink=true

    ReplyDelete
  6. I want to use loadTestData command from which extension I can get this.

    ReplyDelete
  7. Also for Data Driven testing I tried installing flow-control, include4d and data driven extensions but I am getting exception error. Please help me out on this.

    ReplyDelete
  8. Great job, thanks, it helped me a lot :)

    ReplyDelete
  9. How do I do exactly for parameterization in IDE?

    ReplyDelete
  10. For parameterization, I want to get the values from excel or csv file, how can i get it in Selenium IDE. ??

    ReplyDelete
  11. Can anyone suggest that how to do parameterization in sel ide?
    I want to pass 2 or more id for login.
    Is this possible?

    Thanks in advance!!!

    ReplyDelete
    Replies
    1. Post itself gives idea about parametrization..Please have a look in detail.

      Delete
  12. HI,

    I tried using the same code but Selenium hangs on running the script and added data.js and goto_sel_ide.js. But the script gets stuck in the start. The Debug levels logs are as follows. Please can u help me on how to resolve this issue

    [debug] createForWindow
    [debug] browserName: Netscape
    [debug] userAgent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:25.0) Gecko/20100101 Firefox/25.0
    [debug] modifyWindow seleniumMarker1386241082634:undefined
    [debug] _getFrameElement: frameElement=null
    [debug] isPollingForLoad false, this.pollingForLoad[1]: undefined
    [debug] Starting pollForLoad (selenium1386241082635): https://www.google.co.in/search?q=selenium+hangs+on+running+the+script+after+parameterization&ie=utf-8&oe=utf-8&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb&gws_rd=cr&ei=QlugUrfYGcmIrQfc6IDYDw#channel=fflb&q=selenium+hangs+on+running+the+script+after+parameterization&rls=org.mozilla:en-US:official&start=10
    [debug] _getFrameElement: frameElement=null
    [debug] pollForLoad original (selenium1386241082635): https://www.google.co.in/search?q=selenium+hangs+on+running+the+script+after+parameterization&ie=utf-8&oe=utf-8&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb&gws_rd=cr&ei=QlugUrfYGcmIrQfc6IDYDw#channel=fflb&q=selenium+hangs+on+running+the+script+after+parameterization&rls=org.mozilla:en-US:official&start=10
    [debug] _isSamePage: currentHref: https://www.google.co.in/search?q=selenium+hangs+on+running+the+script+after+parameterization&ie=utf-8&oe=utf-8&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb&gws_rd=cr&ei=QlugUrfYGcmIrQfc6IDYDw
    [debug] _isSamePage: originalHref: https://www.google.co.in/search?q=selenium+hangs+on+running+the+script+after+parameterization&ie=utf-8&oe=utf-8&rls=org.mozilla:en-US:official&client=firefox-a&channel=fflb&gws_rd=cr&ei=QlugUrfYGcmIrQfc6IDYDw
    [debug] _isSamePage: sameDoc: true
    [debug] _isSamePage: sameLoc: true
    [debug] _isSamePage: sameHref: true
    [debug] _isSamePage: markedLoc: true
    [debug] pollForLoad continue (selenium1386241082635): undefined
    [debug] modifyWindow seleniumMarker1386241082634:undefined
    [debug] _getFrameElement: frameElement=[object HTMLIFrameElement]
    [debug] frameElement.name=gbsf
    [debug] isPollingForLoad false, missing uniqueId seleniumMarker1386241082634: undefined
    [debug] Starting pollForLoad (selenium1386241082642): https://plus.google.com/u/0/_/notifications/frame?sourceid=1&hl=en&origin=https%3A%2F%2Fwww.google.co.in&jsh=m%3B%2F_%2Fscs%2Fabc-static%2F_%2Fjs%2Fk%3Dgapi.gapi.en.5GL3tg_C6Nc.O%2Fm%3D__features__%2Frt%3Dj%2Fd%3D1%2Frs%3DAItRSTPfsfz-ifAZeiHMk7mKfiGQJuhVFw#pid=1&rpctoken=235123198&_methods=onError%2ConInfo%2ChideNotificationWidget%2CpostSharedMessage%2Creauth%2CsetNotificationWidgetHeight%2CsetNotificationWidgetSize%2CswitchTo%2CnavigateTo%2CsetNotificationText%2CsetNotificationAnimation%2CgetNotificationText%2C_ready%2C_close%2C_open%2C_resizeMe%2C_renderstart&id=gbsf&parent=https%3A%2F%2Fwww.google.co.in&pfname=
    [debug] _getFrameElement: frameElement=[object HTMLIFrameElement]
    [debug] frameElement.name=gbsf
    [debug] modifySeparateTestWindowToDetectPageLoads: this window is a frame; attaching a load listener
    [debug] dgf this.uniqueId=seleniumMarker1386241082634
    [debug] dgf marker=selenium1386241082642
    [debug] dgf frameElement['frame'+this.uniqueId]=selenium1386241082642
    [debug] dgf frameElement[this.uniqueId]=selenium1386241082642
    [debug] getCurrentWindow newPageLoaded = false

    ReplyDelete
  13. Threw an exception: username is not defined


    Am getting above error .. Is anyone help me ?

    ReplyDelete
  14. Have you uploaded JS file with required input?
    Please check initial part of Post for reference.

    ReplyDelete
  15. HI,
    I have modified the code for more than 2 users when the user log-in the page; each user has different contents specified for it.Using the above code data.js and goto_sel_ide.js. It only considers 1st user skips the rest ,it is stuck in loop keeps showing user1 log-in.Could you please advise what can be done here.

    ReplyDelete