Is there a way to execute Javascript from Selenium RC? I have been trying different methods with no success so far.
I attempted the following approach:
I created a custom function in user-extensions.js:
function sayhello() {
document.write('hello');
}
And then called it in WelcomeCept.php like this:
<?php
$I = new WebGuy($scenario);
$I->wait(3000);
selenium.getEval('sayhello');
Command used for execution:
php codecept.phar run acceptance WelcomeCept.php
Result obtained:
Codeception PHP Testing Framework v1.5.5 Powered by PHPUnit 3.7.14 by Sebastian
Bergmann.
Suite acceptance started PHP Fatal error: Call to undefined function
getEval() in
/home/user/Projects/selenium/tests/acceptance/WelcomeCept.php on line
103
FATAL ERROR OCCURRED. TESTS NOT FINISHED. Call to undefined function
getEval() in
/home/user/Projects/selenium/tests/acceptance/WelcomeCept.php:103