Selenium Forum: Functional And Regression Testing Tool.
Would you like to react to this message? Create an account in a few clicks or log in to continue.
Search
Display results as :
Advanced Search
Latest topics
AEM Training | Free Online DemoWed Apr 21, 2021 5:45 pmazharuddin
c# PageFactory - issue initializing elementsFri Nov 01, 2019 8:40 pmthegoatboy
Selenium making automatic connection to random urlsMon Jul 08, 2019 12:58 pmrepairtechsolutions1
How can we design the custom framework in Selenium RCMon Jun 24, 2019 2:26 pmrandybonnettes
What are the new features in Selenium 3.0Tue Jun 18, 2019 5:37 pmpappyvicky
What are you using Selenium for? Fri Apr 12, 2019 3:52 amzhl
LIMITATIONS OF SELENIUMWed Apr 10, 2019 11:23 amswara
Navigation
 Portal
 Index
 Memberlist
 Profile
 FAQ
 Search

Go down
avatar
feuser
Posts : 1
Join date : 2012-10-12

how to record a test case in javascript Empty how to record a test case in javascript

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.
avatar
rosco
Active particpant
Active particpant
Posts : 20
Join date : 2012-04-05

how to record a test case in javascript Empty Re: how to record a test case in javascript

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 ?
avatar
a71688
Regular Participant
Regular Participant
Posts : 27
Join date : 2014-07-23

how to record a test case in javascript Empty Re: how to record a test case in javascript

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
Sponsored content

how to record a test case in javascript Empty Re: how to record a test case in javascript

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