我需要从 selenium RC 执行 javascript,有人知道怎么做吗?
我尝试了以下方法:
在 user-extensions.js 中编写了以下自定义函数:
function sayhello() {
document.write('hello');
}
并在 WelcomeCept.php 中调用如下:
<?php
$I = new WebGuy($scenario);
$I->wait(3000);
selenium.getEval('sayhello');
命令:
php codecept.phar 运行验收 WelcomeCept.php
结果:
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