- feuser
- Posts : 1
Join date : 2012-10-12
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.
Is it possible to do this with Selenium IDE? If yes any guidance would be greatly appreciated.
- roscoActive particpant
- Posts : 20
Join date : 2012-04-05
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 ?
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 ?
- a71688Regular Participant
- Posts : 27
Join date : 2014-07-23
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
Permissions in this forum:
You cannot reply to topics in this forum
|
|