to select random number from select list

Discussion in 'Ruby' started by Pranjal Jain, Apr 10, 2008.

  1. Pranjal Jain

    Pranjal Jain Guest

    I am having a list. I want to select a number in random from that list?
    which command I can use it for doing this?

    For example :

    $ie.row:)class =>"bgTableAltColors",:index
    Automation - Scripting").select

    here instead of "Test automation -scripting" I want to select a option
    in random.
    How can i do it ?

    Please help.
    Thanks in advance.
    Pranjal Jain, Apr 10, 2008
    1. Advertisements

  2. Pranjal Jain

    Heesob Park Guest


    If a list is given:

    list = ["a","b","c"]

    You can do it like this:


    Park Heesob
    Heesob Park, Apr 10, 2008
    1. Advertisements

  3. To get a random element from an array



    Learn Ruby on Rails! Check out the FREE VIDS (for a limited time)
    VIDEO #3 out NOW!
    Julian Leviston, Apr 10, 2008
  4. Pranjal Jain

    saras Guest

    wow you love thouse videos
    saras, Apr 10, 2008
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.