/* This is an experiment in using the Narcissus JavaScript engine to allow Selenium scripts to be written in plain JavaScript. The 'jsparse' function will compile each high level block into a Selenium table script. TODO: 1) Test! (More browsers, more sample scripts) 2) Stepping and walking lower levels of the parse tree 3) Calling Selenium commands directly from JavaScript 4) Do we want comments to appear in the TestRunner? 5) Fix context so variables don't have to be global For now, variables defined with "var" won't be found if used later on in a script. 6) Fix formatting */ function jsparse() { var script = document.getElementById('sejs') var fname = 'javascript script'; parse_result = parse(script.text, fname, 0); var x2 = new ExecutionContext(GLOBAL_CODE); ExecutionContext.current = x2; var new_test_source = ''; var new_line = ''; for (i=0;icurrentTest.doNextCommand()' + '' + script_fragment + '' + '\n'; new_test_source += new_line; //eval(script_fragment); }; execute(parse_result,x2) // Create HTML Table body = document.body body.innerHTML += ""+ "" + "" + new_test_source + ""; //body.innerHTML = "
" + parse_result + "
" }
// " + document.title + "