TestJS-functions.html 1.03 KB
Newer Older
Rafael Monnerat's avatar
Rafael Monnerat committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38
<html>
<head>
 <title>Test JavaScript Functions</title>
 <link rel="stylesheet" type="text/css" href="../core/selenium_table.css" />

 <script type="text/javascript" src="../core/scripts/narcissus-defs.js"></script>
 <script type="text/javascript" src="../core/scripts/narcissus-parse.js"></script>
 <script type="text/javascript" src="../core/scripts/narcissus-exec.js"></script>
 <script type="text/javascript" src="../core/scripts/js2html.js"></script>

 <script id="setup" type="text/javascript">
    // put any setup or utility functions here..

 </script>

</head>
<body onload="jsparse(document);">

<script id="sejs" type="text/se+js">

var _url = "../tests/html/show_message.html?msg="


// You can refactor common code into functions...
puts = function(i) {
    se.doOpen(_url+i)
    se.doWaitForPageToLoad(5000)
};

puts ('This_was_printed_from_inside_a_function')

// define and call in one line
one_liner = function() { se.doOpen(_url+'Neat!'); se.doWaitForPageToLoad(5000); }()

</script>

</body>
</html>