Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

random email JS

it('should input random email into input field', async () => {
    
    
    const characters ='ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789';
    function generateString(length) {
        let result = ' ';
        const charactersLength = characters.length;
        for ( let i = 0; i < length; i++ ) {
            result += characters.charAt(Math.floor(Math.random() * charactersLength));
        }
    
        return result;
    }
    let input = await $('#email')
        await input.addValue(generateString(10) + '@gmail.com')
    
        await browser.pause(4000);        
    })
createRandomEmail() {return "Username" + Math.floor(Math.random() * 10000 ) + "gmail.com" }
 
PREVIOUS NEXT
Tagged: #random #email #JS
ADD COMMENT
Topic
Name
2+4 =