How do I use Selenium IDE on Firefox to test JavaScript generated codes? -
How do I use Selenium IDE on Firefox to test JavaScript generated codes? -
i trying test website contains alot of javascript. javascript alot of opening new dialog allow user take "yes" or "no". has function upon right clicking, opens right click menu contains many functions such zip, delete etc.
in selenium, can utilize selenium ide login, click, , others, don't know how test functions.
i've read there codes can write such in java run test, i'm hoping create work using simple selenium ide if possible. if not, can post simple testing code works run java scripts? such click button -> javascript menu pops -> click ok on pop up.
thank much.
right context menus can little tricky. i'd suggest making custom commands right click context menu. add together code article custom user-extensions.js file.
http://old.nabble.com/how-to-recognise-right-click-of-the-mouse-in-ide-td14913052.html
the parameters these functions in these commands become expected arguments of selenium ide commands. if want create simple, can phone call javascript functions in these custom user-extension commands. :-) might bit lazy , isn't truely testing right click doing, work.
option #1 - if using ide:
specify user-extensions.js file under selenium ide > options (menu) > options (menu option) > general tab, browse file under "selenium core extensions".
option #2 - if using selenium rc server:
if you're not using ide , using selenium rc server client driver (like junit example), must specify path of *.js file -userextensions parameter when start selenium rc server on command line. said wanted utilize ide, i'd ignore this. takes quite bit of other setup utilize selenium rc server.
java -jar selenium-server.jar -userextensions user-extensions.js
=======================
i've never done before, made next custom command (javascript function) in custom user-extensions.js file, , worked me. had exit , restart ide before found it. reason, type after "do" in "command" field in ide. looks added "customalertandwait" ide well.
code in user-extensions.js file:
selenium.prototype.docustomalert = function(starget, svalue) { alert('target: ' + starget + ' ... value: ' + svalue); };
selenium ide command details:
command: customalert target: custom alert target value: custom alert value
selenium selenium-webdriver selenium-ide
Comments
Post a Comment