need help java script random numbers and letters

Support for iMacros. The iMacros software is the unique solution for automating every activity inside a web browser, for data extraction and web testing.
Forum rules
Before asking a question or reporting an issue:
1. Please review the list of FAQ's.
2. Use the search box (at the top of each forum page) to see if a similar problem or question has already been addressed.
3. Try searching the iMacros Wiki - it contains the complete iMacros reference as well as plenty of samples and tutorials.
4. We can respond much faster to your posts if you include the following information:CLICK HERE FOR IMPORTANT INFORMATION TO INCLUDE IN YOUR POST
Post Reply
asan
Posts: 4
Joined: Sat Sep 11, 2010 7:11 pm

need help java script random numbers and letters

Post by asan » Wed Dec 03, 2014 1:15 am

here is what i have come up with, I am trying to generate a 10 character randoms, all caps from a java file here my code, any help would be great thanks

.js

Code: Select all

var randomnumber=Array.apply(0, Array(10)).map(function() {
    return (function(charset){
        return charset.charAt(Math.floor(Math.random() * charset.length))
    }('ABCDEFGHIJKLMNOPQRSTUVWXYZ123456789'));
}).join('')
iimSet("rnumber", randomnumber);
iimPlay("fuel.iim")
.iim

Code: Select all

VERSION BUILD=8871104 RECORDER=FX
TAB T=1
TAG POS=1 TYPE=INPUT:TEXT FORM=NAME:NoFormName ATTR=ID:code CONTENT={{rnumber}}
Post Reply