Search
 
 

Display results as :
 


Rechercher Advanced Search

Latest topics
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

how to record a test case in javascript

View previous topic View next topic Go down

how to record a test case in javascript

Post by feuser on Fri Oct 12, 2012 12:21 am

Hi,
Is it possible to do this with Selenium IDE? If yes any guidance would be greatly appreciated.

feuser

Posts : 1
Join date : 2012-10-12

Back to top Go down

Re: how to record a test case in javascript

Post by rosco on Mon Oct 15, 2012 6:59 pm

Hello,
What do you want to do ???
With selenium ide you can record the test case (by defaut GUI is set in recorder option at open). What do you want to do with javascript ?

rosco
Active particpant
Active particpant

Posts : 20
Join date : 2012-04-05

Back to top Go down

Re: how to record a test case in javascript

Post by a71688 on Fri Oct 30, 2015 5:26 pm

Example dates where i check that todays date is being displayed. Scripts loops and stop when found


    open
    ${testTools}
   


    type
    id=useridinput
    ${cprNumber}


    clickAndWait
    id=submit_view_existing
   


    label
    LOOP PIN CODES
   


    storeTextPresent
    javascript{var currentDate = new Date(); var month = currentDate.getMonth() + 1; if (month < 10) { month = "0" + month }; var day = currentDate.getDate(); if (day < 10) { day = "0" + day }; var year = currentDate.getFullYear(); curentDate=(year + "-" +month + "-" + day);}
    date


    gotoIf
    ${date}==true
    END LOOP PIN CODES


    pause
    2000
   


    refresh
   
   


    waitForPageToLoad
    60000
   


    gotoIf
    ${date}==false
    LOOP PIN CODES


    label
    END LOOP PIN CODES
   


    open
    ${testTools}
   


    type
    id=useridinput
    ${cprNumber}


    clickAndWait
    id=submit_view_existing
   


    label
    LOOP Pincode serial
   


    storeTextPresent
    ACTIVE
    isActive


    gotoIf
    ${isActive}==true
    END LOOP Pincode serial


    pause
    10000
   


    refresh
   
   


    waitForPageToLoad
    60000
   


    gotoIf
    ${isActive}==false
    LOOP Pincode serial


    label
    END LOOP Pincode serial
   


    waitForText
    id=cardstatus0
    PENDING


    waitForText
    //table[@id='pincodes_details']/tbody/tr[2]/td[2]
    ACTIVE


    selectWindow
    null
   


    storeText
    css=#cardserial0 > a
    Cardserial


    storeText
    id=nemid_number
    userid


    storeEval
    storedVars['userid'].match(/\d+.\d/)
    userid


    storeText
    id=pin_data_active
    pin


    storeEval
    'CPR:' + storedVars.cprNumber +' / NemID:'+ storedVars.userid
    reportDataFromUa2a

a71688
Regular Participant
Regular Participant

Posts : 27
Join date : 2014-07-23

Back to top Go down

Re: how to record a test case in javascript

Post by Sponsored content Today at 8:49 am


Sponsored content


Back to top Go down

View previous topic View next topic Back to top

- Similar topics

 
Permissions in this forum:
You cannot reply to topics in this forum